From 44f080c46e84090daf81b4d142359f8e38d7c5ee Mon Sep 17 00:00:00 2001 From: Matt Domsch Date: Fri, 18 Nov 2005 01:10:54 -0800 Subject: [PATCH] [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 --- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index ea89dca..01a1f6b 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); } -- 2.7.4