]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: mockup: fix NULL pointer dereference when removing debugfs
authorBartosz Golaszewski <brgl@bgdev.pl>
Tue, 20 Sep 2022 07:18:41 +0000 (09:18 +0200)
committerBartosz Golaszewski <brgl@bgdev.pl>
Tue, 20 Sep 2022 14:06:42 +0000 (16:06 +0200)
commitfc96c72879b4b2df522d0b3be5f1dabcb101d10f
treeb5897fbe58abeae0f90b73c43a7e2715531f2ae6
parent27f9b03c399355c5a93e7f1cf491765f72d4bb7d
gpio: mockup: fix NULL pointer dereference when removing debugfs

We now remove the device's debugfs entries when unbinding the driver.
This now causes a NULL-pointer dereference on module exit because the
platform devices are unregistered *after* the global debugfs directory
has been recursively removed. Fix it by unregistering the devices first.

Fixes: 57edd9b76f01 ("gpio: mockup: remove gpio debugfs when remove device")
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-mockup.c