From: Konstantin Khlebnikov Date: Fri, 14 Dec 2012 01:02:36 +0000 (+0000) Subject: mISDN: fix race in timer canceling on module unloading X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4a0ae7b0a9e55db9b85f8abda623f145311eb951;p=openwrt%2Fstaging%2Fblogic.git mISDN: fix race in timer canceling on module unloading Using timer_pending() without additional syncronization is racy, del_timer_sync() must be used here for waiting in-flight handler. Bug caught with help from "debug-objects" during random insmod/rmmod. Signed-off-by: Konstantin Khlebnikov Cc: Karsten Keil Cc: David S. Miller Cc: netdev Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c index 28c99c623bcd..22b720ec80cb 100644 --- a/drivers/isdn/mISDN/dsp_core.c +++ b/drivers/isdn/mISDN/dsp_core.c @@ -1217,8 +1217,7 @@ static void __exit dsp_cleanup(void) { mISDN_unregister_Bprotocol(&DSP); - if (timer_pending(&dsp_spl_tl)) - del_timer(&dsp_spl_tl); + del_timer_sync(&dsp_spl_tl); if (!list_empty(&dsp_ilist)) { printk(KERN_ERR "mISDN_dsp: Audio DSP object inst list not "