Re: [rtc-linux] Re: [BUG 2.6.30_rc5] Null pointer dereference in rtc-cmos driver

From: Kay Sievers
Date: Sat May 16 2009 - 20:37:23 EST


On Sun, May 17, 2009 at 01:36, Kay Sievers <kay.sievers@xxxxxxxx> wrote:
> On Sun, May 17, 2009 at 00:49, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>> This should fix the symptoms:
>
>> +++ a/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 < 0)
>> + Â Â Â Â Â Â Â return retval;
>> Â#endif
>
> That looks like a good fix.
>
>> Can someone please test it?
>
> I'll try to reproduce it.

Looks good. It makes the issue go away:
Error: Driver 'rtc_cmos' is already registered, aborting...
initcall cmos_init+0x0/0x55 [rtc_cmos] returned -17 after 51 usecs
initcall cmos_init+0x0/0x55 [rtc_cmos] returned with error code -17

Now to the driver core fix to prevent that ...

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/