Staging: panel: fix oops on panel_cleanup_module
Check for null pardevice (not registered, ej: panel never attached, inexistent parport, etc. ) before calling parport_release, parport_unregister_device, and related funcs on module release. Signed-off-by: Costantino Leandro <lcostantino@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
096c55d1de
commit
5789813e73
@@ -2164,6 +2164,7 @@ static void __exit panel_cleanup_module(void)
|
|||||||
if (scan_timer.function != NULL)
|
if (scan_timer.function != NULL)
|
||||||
del_timer(&scan_timer);
|
del_timer(&scan_timer);
|
||||||
|
|
||||||
|
if (pprt != NULL) {
|
||||||
if (keypad_enabled)
|
if (keypad_enabled)
|
||||||
misc_deregister(&keypad_dev);
|
misc_deregister(&keypad_dev);
|
||||||
|
|
||||||
@@ -2174,9 +2175,9 @@ static void __exit panel_cleanup_module(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: free all input signals */
|
/* TODO: free all input signals */
|
||||||
|
|
||||||
parport_release(pprt);
|
parport_release(pprt);
|
||||||
parport_unregister_device(pprt);
|
parport_unregister_device(pprt);
|
||||||
|
}
|
||||||
parport_unregister_driver(&panel_driver);
|
parport_unregister_driver(&panel_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user