mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] Correct misc_register return code handling in several drivers
Clean up several code points in which the return code from misc_register is not handled properly. Several modules failed to deregister various hooks when misc_register fails, and this patch cleans them up. Also there are a few modules that legitimately don't care about the failure status of misc register. These drivers however unilaterally call misc_deregister on module unload. Since misc_register doesn't initialize the list_head in the init_routine if it fails, the deregister operation is at risk for oopsing when list_del is called. The initial solution was to manually init the list in the miscdev structure in each of those modules, but the consensus in this thread was to consolodate and do that universally inside misc_register. Signed-off-by: Neil Horman <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Kylene Jo Hall <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Olaf Hering <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
dc168427e6
commit
5d469ec0f4
5 changed files with 26 additions and 7 deletions
|
|
@ -529,7 +529,8 @@ static int __init apm_emu_init(void)
|
|||
if (apm_proc)
|
||||
apm_proc->owner = THIS_MODULE;
|
||||
|
||||
misc_register(&apm_device);
|
||||
if (misc_register(&apm_device) != 0)
|
||||
printk(KERN_INFO "Could not create misc. device for apm\n");
|
||||
|
||||
pmu_register_sleep_notifier(&apm_sleep_notifier);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue