]> git.baikalelectronics.ru Git - kernel.git/commit
nvmem: core: Fix device reference leak
authorAlban Bedel <albeu@free.fr>
Mon, 28 Jan 2019 15:55:05 +0000 (15:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 15:24:15 +0000 (16:24 +0100)
commit4d5264a4388aa5fb8edfecf453cd30b0e66cb876
tree724d610a5a4320376f7cbb526a89de17ec14c748
parent88850404593fa974768fc3e2017147cca15f557c
nvmem: core: Fix device reference leak

__nvmem_device_get() make use of bus_find_device() to get the relevant
device and this function increase the reference count of the device
found, however this is not accounted for anywhere. Fix
__nvmem_device_get() and __nvmem_device_put() to properly release this
reference count.

Signed-off-by: Alban Bedel <albeu@free.fr>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c