Bug 13326
Summary: | [PATCH]Null pointer dereference in rtc-cmos driver | ||
---|---|---|---|
Product: | Drivers | Reporter: | Rafael J. Wysocki (rjw) |
Component: | Other | Assignee: | drivers_other |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | alan, janboe.ye |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.30-rc5 | Subsystem: | |
Regression: | Yes | Bisected commit-id: | |
Bug Depends on: | |||
Bug Blocks: | 13070 | ||
Attachments: | Driver Core: do not oops when driver_unregister() is called for unregistered drivers |
Description
Rafael J. Wysocki
2009-05-16 21:28:15 UTC
This is because rtc-cmos driver continues when pnp_register_driver(&cmos_pnp_driver) fail. My patch fixes this bug. diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 23e10b6..da132f6 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -1179,7 +1179,9 @@ static int __init cmos_init(void) int retval = 0; #ifdef CONFIG_PNP - pnp_register_driver(&cmos_pnp_driver); + retval = pnp_register_driver(&cmos_pnp_driver); + if (retval) + return retval; #endif if (!cmos_rtc.dev) Created attachment 21523 [details] Driver Core: do not oops when driver_unregister() is called for unregistered drivers Handled-By : Kay Sievers <kay.sievers@vrfy.org> Fixed by commit 5c8563d773c0e9f0ac2a552e84806decd98ce732 . |