Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Fix timer race

When closing the driver or reinitializing the hardware there is the
usual del_timer() race condition that exists when timers re-add
themselves. Fix by conversion to del_timer_sync().

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Ralf Baechle and committed by
Jeff Garzik
cfadbd29 089fff2a

+2 -2
+2 -2
drivers/net/ioc3-eth.c
··· 1017 1017 struct ioc3_private *ip = netdev_priv(dev); 1018 1018 struct ioc3 *ioc3 = ip->regs; 1019 1019 1020 - del_timer(&ip->ioc3_timer); /* Kill if running */ 1020 + del_timer_sync(&ip->ioc3_timer); /* Kill if running */ 1021 1021 1022 1022 ioc3_w_emcr(EMCR_RST); /* Reset */ 1023 1023 (void) ioc3_r_emcr(); /* Flush WB */ ··· 1081 1081 { 1082 1082 struct ioc3_private *ip = netdev_priv(dev); 1083 1083 1084 - del_timer(&ip->ioc3_timer); 1084 + del_timer_sync(&ip->ioc3_timer); 1085 1085 1086 1086 netif_stop_queue(dev); 1087 1087