WSL2-Linux-Kernel/drivers/nvmem
Vadym Kochan fc9eec4d64 nvmem: core: fix possibly memleak when use nvmem_cell_info_to_nvmem_cell()
Fix missing 'kfree_const(cell->name)' when call to
nvmem_cell_info_to_nvmem_cell() in several places:

     * after nvmem_cell_info_to_nvmem_cell() failed during
       nvmem_add_cells()

     * during nvmem_device_cell_{read,write} when cell->name is
       kstrdup'ed() without calling kfree_const() at the end, but
       really there is no reason to do that 'dup, because the cell
       instance is allocated on the stack for some short period to be
       read/write without exposing it to the caller.

So the new nvmem_cell_info_to_nvmem_cell_nodup() helper is introduced
which is used to convert cell_info -> cell without name duplication as
a lighweight version of nvmem_cell_info_to_nvmem_cell().

Fixes: e2a5402ec7 ("nvmem: Add nvmem_device based consumer apis.")
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Link: https://lore.kernel.org/r/20200923204456.14032-1-vadym.kochan@plvision.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-27 14:25:48 +02:00
..
Kconfig nvmem: update Kconfig description 2020-07-29 17:12:09 +02:00
Makefile
bcm-ocotp.c
core.c nvmem: core: fix possibly memleak when use nvmem_cell_info_to_nvmem_cell() 2020-09-27 14:25:48 +02:00
imx-iim.c
imx-ocotp-scu.c
imx-ocotp.c
jz4780-efuse.c nvmem: jz4780-efuse: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:20:02 +02:00
lpc18xx_eeprom.c
lpc18xx_otp.c
meson-efuse.c
meson-mx-efuse.c
mtk-efuse.c nvmem: mtk-efuse: Remove EFUSE register write support 2020-09-17 18:48:23 +02:00
mxs-ocotp.c
qcom-spmi-sdam.c nvmem: qcom-spmi-sdam: Enable multiple devices 2020-07-29 17:12:09 +02:00
qfprom.c nvmem: qfprom: Add fuse blowing support 2020-07-29 17:12:09 +02:00
rave-sp-eeprom.c
rockchip-efuse.c
rockchip-otp.c
sc27xx-efuse.c nvmem: sc27xx: add sc2730 efuse support 2020-07-29 17:12:08 +02:00
snvs_lpgpr.c
sprd-efuse.c nvmem: sprd: Fix return value of sprd_efuse_probe() 2020-07-29 17:12:08 +02:00
stm32-romem.c
sunxi_sid.c
uniphier-efuse.c
vf610-ocotp.c
zynqmp_nvmem.c