Subject : [BUG 2.6.30_rc5] Null pointer dereference in rtc-cmos driver Submitter : Ozan Çağlayan <ozan@pardus.org.tr> Date : 2009-05-14 16:16 References : http://marc.info/?l=linux-kernel&m=124231783704696&w=4 This entry is being used for tracking a regression from 2.6.29. Please don't close it until the problem is fixed in the mainline.
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>
Patch : http://bugzilla.kernel.org/attachment.cgi?id=21523
Fixed by commit 5c8563d773c0e9f0ac2a552e84806decd98ce732 .