From: Matt Domsch Date: Fri, 18 Nov 2005 09:10:54 +0000 (-0800) Subject: [PATCH] ipmi: missing NULL test for kthread X-Git-Tag: v2.6.15-rc2~32 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44f080c46e84090daf81b4d142359f8e38d7c5ee;p=linux-2.6 [PATCH] ipmi: missing NULL test for kthread 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 Acked-by: Corey Minyard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index ea89dca3db..01a1f6badb 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -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); }