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

uwb: fix use of del_timer_sync() in interrupt

del_timer_sync() cannot be used in interrupt.
Replace it with del_timer() and a flag

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
9426cd05 2fbe2bf1

+11 -1
+11 -1
drivers/uwb/neh.c
··· 107 107 u8 evt_type; 108 108 __le16 evt; 109 109 u8 context; 110 + u8 completed; 110 111 uwb_rc_cmd_cb_f cb; 111 112 void *arg; 112 113 ··· 410 409 struct device *dev = &rc->uwb_dev.dev; 411 410 struct uwb_rc_neh *neh; 412 411 struct uwb_rceb *notif; 412 + unsigned long flags; 413 413 414 414 if (rceb->bEventContext == 0) { 415 415 notif = kmalloc(size, GFP_ATOMIC); ··· 424 422 } else { 425 423 neh = uwb_rc_neh_lookup(rc, rceb); 426 424 if (neh) { 427 - del_timer_sync(&neh->timer); 425 + spin_lock_irqsave(&rc->neh_lock, flags); 426 + /* to guard against a timeout */ 427 + neh->completed = 1; 428 + del_timer(&neh->timer); 429 + spin_unlock_irqrestore(&rc->neh_lock, flags); 428 430 uwb_rc_neh_cb(neh, rceb, size); 429 431 } else 430 432 dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n", ··· 574 568 unsigned long flags; 575 569 576 570 spin_lock_irqsave(&rc->neh_lock, flags); 571 + if (neh->completed) { 572 + spin_unlock_irqrestore(&rc->neh_lock, flags); 573 + return; 574 + } 577 575 if (neh->context) 578 576 __uwb_rc_neh_rm(rc, neh); 579 577 else