linux/drivers/nvmem
Johan Hovold 3360acdf83 nvmem: core: fix leaks on registration errors
Make sure to deregister and release the nvmem device and underlying
memory on registration errors.

Note that the private data must be freed using put_device() once the
struct device has been initialised.

Also note that there's a related reference leak in the deregistration
function as reported by Mika Westerberg which is being fixed separately.

Fixes: b6c217ab9b ("nvmem: Add backwards compatibility support for older EEPROM drivers.")
Fixes: eace75cfdc ("nvmem: Add a simple NVMEM framework for nvmem providers")
Cc: stable <stable@vger.kernel.org>     # 4.3
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-09 12:08:27 +02:00
..
bcm-ocotp.c nvmem: correct Broadcom OTP controller driver writes 2017-06-09 12:08:27 +02:00
core.c nvmem: core: fix leaks on registration errors 2017-06-09 12:08:27 +02:00
imx-iim.c nvmem: Add driver for the i.MX IIM 2017-04-08 17:51:48 +02:00
imx-ocotp.c nvmem: imx-ocotp: add write support 2017-04-08 17:51:48 +02:00
Kconfig nvmem: Add driver for the i.MX IIM 2017-04-08 17:51:48 +02:00
lpc18xx_eeprom.c nvmem: lpc18xx-eeprom: remove nvmem regmap dependency 2016-05-01 14:01:13 -07:00
lpc18xx_otp.c nvmem: add NXP LPC18xx OTP driver 2016-11-10 15:34:55 +01:00
Makefile nvmem: Add driver for the i.MX IIM 2017-04-08 17:51:48 +02:00
meson-efuse.c firmware: meson-sm: Check for buffer output size 2017-03-23 12:22:32 -07:00
mtk-efuse.c nvmem: mtk-efuse: remove nvmem regmap dependency 2016-06-25 07:42:55 -07:00
mxs-ocotp.c nvmem: mxs-ocotp: remove nvmem regmap dependency 2016-06-25 07:42:55 -07:00
qfprom.c nvmem: qfprom: Allow single byte accesses for read/write 2017-01-04 18:22:47 +01:00
rockchip-efuse.c nvmem: rockchip-efuse: add rk3399-efuse support 2016-09-02 17:22:51 +02:00
sunxi_sid.c nvmem: sunxi-sid: add support for H3's SID controller 2017-04-08 17:51:48 +02:00
vf610-ocotp.c nvmem: vif610-ocotp: remove nvmem regmap dependency 2016-05-01 14:01:00 -07:00