[PATCH] ipmi: missing NULL test for kthread
authorMatt Domsch <Matt_Domsch@dell.com>
Fri, 18 Nov 2005 09:10:54 +0000 (01:10 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 18 Nov 2005 15:49:45 +0000 (07:49 -0800)
On IPMI systems with BT interfaces, we don't start the kernel thread, so
smi_info->thread is NULL.  Test for NULL when stopping the thread, because
kthread_stop() doesn't, and an oops ensues otherwise.

Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
Acked-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/ipmi/ipmi_si_intf.c

index ea89dca..01a1f6b 100644 (file)
@@ -2203,7 +2203,7 @@ static void setup_xaction_handlers(struct smi_info *smi_info)
 
 static inline void wait_for_timer_and_thread(struct smi_info *smi_info)
 {
-       if (smi_info->thread != ERR_PTR(-ENOMEM))
+       if (smi_info->thread != NULL && smi_info->thread != ERR_PTR(-ENOMEM))
                kthread_stop(smi_info->thread);
        del_timer_sync(&smi_info->si_timer);
 }