Re: BUG: spinlock bad magic on CPU#1, modprobe/815 - led-triggers

From: Vegard Nossum
Date: Wed Jul 16 2008 - 10:22:49 EST

On Wed, Jul 16, 2008 at 2:24 PM, Zdenek Kabelac
<zdenek.kabelac@xxxxxxxxx> wrote:
> Hello
> I'm running 2.6.26 kernel - git commit: bce7f793daec3e65ec5c5705d2457b81fe7b5725
> I've T61, 2GB, C2D, x86_64
> I'm getting this oops while using 64bit kernel and running mostly 32bit system.
> This one happens sometimes during boot - unpredictible - usually once
> in 15 boots.

Thanks for the report.

It looks like the error is in led_classdev_register(); the led_cdev is
added to the leds_list *before* the led_cdev->trigger_lock is

(This might also explain why you don't always hit it.)

On the other hand, I might be completely wrong. The following NULL
pointer dereference bothers me somewhat as it isn't entirely clear why
it appears.

I've added a couple of Ccs.

Can you try the patch I've attached?


"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036

Attachment: led-class.patch
Description: Binary data