Commit c372d43a authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] check various return codes in advantechwdt.

Adds missing checks. Probably another from William Stinson
parent 0099be84
...@@ -241,11 +241,21 @@ advwdt_init(void) ...@@ -241,11 +241,21 @@ advwdt_init(void)
advwdt_validate_timeout(); advwdt_validate_timeout();
spin_lock_init(&advwdt_lock); spin_lock_init(&advwdt_lock);
misc_register(&advwdt_miscdev); if (misc_register(&advwdt_miscdev))
return -ENODEV;
#if WDT_START != WDT_STOP #if WDT_START != WDT_STOP
request_region(WDT_STOP, 1, "Advantech WDT"); if (!request_region(WDT_STOP, 1, "Advantech WDT")) {
misc_deregister(&advwdt_miscdev);
return -EIO;
}
#endif
if (!request_region(WDT_START, 1, "Advantech WDT")) {
misc_deregister(&advwdt_miscdev);
#if WDT_START != WDT_STOP
release_region(WDT_STOP, 1);
#endif #endif
request_region(WDT_START, 1, "Advantech WDT"); return -EIO;
}
register_reboot_notifier(&advwdt_notifier); register_reboot_notifier(&advwdt_notifier);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment