summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-xgs-iproc.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-10-05 15:24:49 +0300
committerBartosz Golaszewski <brgl@bgdev.pl>2021-10-06 14:04:04 +0300
commit6fda593f3082ef1aa783ac13e89f673fd69a2cb6 (patch)
tree045b8bc8e07feb6816358f9e6c35d7542d162935 /drivers/gpio/gpio-xgs-iproc.c
parent55a9968c7e139209a9e93d4ca4321731bea5fc95 (diff)
downloadlinux-6fda593f3082ef1aa783ac13e89f673fd69a2cb6.tar.xz
gpio: mockup: Convert to use software nodes
The gpio-mockup driver creates the properties that are shared between platform and GPIO devices. Because of that, the properties may not be removed at the proper point of time without provoking a use-after-free as shown in the following backtrace: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 103 at lib/refcount.c:28 refcount_warn_saturate+0xd1/0x120 ... Call Trace: kobject_put+0xdc/0xf0 software_node_notify_remove+0xa8/0xc0 device_del+0x15a/0x3e0 That's why the driver has to manage the lifetime of the software nodes by itself. The problem originates from the old device_add_properties() API, but has been only revealed after the commit bd1e336aa853 ("driver core: platform: Remove platform_device_add_properties()"). Hence, it's used as a landmark for backporting. Fixes: bd1e336aa853 ("driver core: platform: Remove platform_device_add_properties()") Reported-by: Kent Gibson <warthog618@gmail.com> Tested-by: Kent Gibson <warthog618@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> [Bartosz: tweaked local variable placement] Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpio-xgs-iproc.c')
0 files changed, 0 insertions, 0 deletions