aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJes Sorensen <jsorensen@fb.com>2019-08-28 16:36:25 -0400
committerCorey Minyard <cminyard@mvista.com>2019-09-12 16:03:18 -0500
commitc9acc3c4f8e42ae538aea7f418fddc16f257ba75 (patch)
tree8cd75733593157def2fe78aeadb37d21c5bb4c22 /drivers/char
parentipmi: move message error checking to avoid deadlock (diff)
downloadlinux-dev-c9acc3c4f8e42ae538aea7f418fddc16f257ba75.tar.xz
linux-dev-c9acc3c4f8e42ae538aea7f418fddc16f257ba75.zip
ipmi_si_intf: Fix race in timer shutdown handling
smi_mod_timer() enables the timer before setting timer_running. This means the timer can be running when we get to stop_timer_and_thread() without timer_running having been set, resulting in del_timer_sync() not being called and the timer being left to cause havoc during shutdown. Instead just call del_timer_sync() unconditionally Signed-off-by: Jes Sorensen <jsorensen@fb.com> Message-Id: <20190828203625.32093-2-Jes.Sorensen@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index d58253432a9a..6b9a0593d2eb 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1843,8 +1843,7 @@ static inline void stop_timer_and_thread(struct smi_info *smi_info)
}
smi_info->timer_can_start = false;
- if (smi_info->timer_running)
- del_timer_sync(&smi_info->si_timer);
+ del_timer_sync(&smi_info->si_timer);
}
static struct smi_info *find_dup_si(struct smi_info *info)