diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2016-06-03 19:10:02 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-06-08 10:40:29 +0200 |
commit | f4833b8cc7edab57d3f3033e549111a546c2e02b (patch) | |
tree | 9ec107aa22c29db288c6444ee21d3f1be5521266 /drivers/gpio/gpio-tb10x.c | |
parent | gpiolib: Fix NULL pointer deference (diff) | |
download | linux-f4833b8cc7edab57d3f3033e549111a546c2e02b.tar.xz linux-f4833b8cc7edab57d3f3033e549111a546c2e02b.zip |
gpiolib: Fix unaligned used of reference counters
gpiolib relies on the reference counters to clean up the gpio_device
structure.
Although the number of get/put is properly aligned on gpiolib.c
itself, it does not take into consideration how the referece counters
are affected by other external functions such as cdev_add and device_add.
Because of this, after the last call to put_device, the reference counter
has a value of +3, therefore never calling gpiodevice_release.
Due to the fact that some of the device has already been cleaned on
gpiochip_remove, the library will end up OOPsing the kernel (e.g. a call
to of_gpiochip_find_and_xlate).
Cc: stable@vger.kernel.org
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tb10x.c')
0 files changed, 0 insertions, 0 deletions