Skip to content

Commit

Permalink
mISDN: fix race in timer canceling on module unloading
Browse files Browse the repository at this point in the history
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 <khlebnikov@openvz.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Konstantin Khlebnikov authored and David S. Miller committed Dec 14, 2012
1 parent 4008e97 commit 4a0ae7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/isdn/mISDN/dsp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 4a0ae7b

Please sign in to comment.