mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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: 303e6da994
("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>
This commit is contained in:
parent
521a547ced
commit
b7df41a6f7
@ -597,9 +597,9 @@ static int __init gpio_mockup_init(void)
|
||||
|
||||
static void __exit gpio_mockup_exit(void)
|
||||
{
|
||||
gpio_mockup_unregister_pdevs();
|
||||
debugfs_remove_recursive(gpio_mockup_dbg_dir);
|
||||
platform_driver_unregister(&gpio_mockup_driver);
|
||||
gpio_mockup_unregister_pdevs();
|
||||
}
|
||||
|
||||
module_init(gpio_mockup_init);
|
||||
|
Loading…
Reference in New Issue
Block a user