2004-11-07 06:35:01

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH] panic_blink and i8042 unloading

Hi,

At unload i8042 sets panic_blink to 0. This will cause problems if kernel
panics later as it will just use it assuming that the pointer is correct.

Please consider the patch below that checks if panic_blink is NULL right
in panic() and sets it to no_blink instead.

--
Dmitry


===================================================================


[email protected], 2004-11-06 22:53:46-05:00, [email protected]
If panic_blink is NULL set it to no_blink before using.

Signed-off-by: Dmitry Torokhov <[email protected]>


panic.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)


===================================================================



diff -Nru a/kernel/panic.c b/kernel/panic.c
--- a/kernel/panic.c 2004-11-07 01:31:36 -05:00
+++ b/kernel/panic.c 2004-11-07 01:31:36 -05:00
@@ -42,7 +42,7 @@
}

/* Returns how long it waited in ms */
-long (*panic_blink)(long time) = no_blink;
+long (*panic_blink)(long time);
EXPORT_SYMBOL(panic_blink);

/**
@@ -75,7 +75,10 @@
smp_send_stop();
#endif

- notifier_call_chain(&panic_notifier_list, 0, buf);
+ notifier_call_chain(&panic_notifier_list, 0, buf);
+
+ if (!panic_blink)
+ panic_blink = no_blink;

if (panic_timeout > 0)
{


2004-11-07 10:14:45

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] panic_blink and i8042 unloading

On Sun, Nov 07, 2004 at 01:34:31AM -0500, Dmitry Torokhov wrote:
> Hi,
>
> At unload i8042 sets panic_blink to 0. This will cause problems if kernel
> panics later as it will just use it assuming that the pointer is correct.
>
> Please consider the patch below that checks if panic_blink is NULL right
> in panic() and sets it to no_blink instead.

Thanks, looks good.

-Andi