Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299432
b: refs/heads/master
c: 9426cd0
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent b5fb383 commit a0a3631
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2fbe2bf1fd37f9d99950bd8d8093623cf22cf08b
refs/heads/master: 9426cd05682745d1024dbabdec5631309bd2f480
12 changes: 11 additions & 1 deletion trunk/drivers/uwb/neh.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ struct uwb_rc_neh {
u8 evt_type;
__le16 evt;
u8 context;
u8 completed;
uwb_rc_cmd_cb_f cb;
void *arg;

Expand Down Expand Up @@ -409,6 +410,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size
struct device *dev = &rc->uwb_dev.dev;
struct uwb_rc_neh *neh;
struct uwb_rceb *notif;
unsigned long flags;

if (rceb->bEventContext == 0) {
notif = kmalloc(size, GFP_ATOMIC);
Expand All @@ -422,7 +424,11 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size
} else {
neh = uwb_rc_neh_lookup(rc, rceb);
if (neh) {
del_timer_sync(&neh->timer);
spin_lock_irqsave(&rc->neh_lock, flags);
/* to guard against a timeout */
neh->completed = 1;
del_timer(&neh->timer);
spin_unlock_irqrestore(&rc->neh_lock, flags);
uwb_rc_neh_cb(neh, rceb, size);
} else
dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n",
Expand Down Expand Up @@ -568,6 +574,10 @@ static void uwb_rc_neh_timer(unsigned long arg)
unsigned long flags;

spin_lock_irqsave(&rc->neh_lock, flags);
if (neh->completed) {
spin_unlock_irqrestore(&rc->neh_lock, flags);
return;
}
if (neh->context)
__uwb_rc_neh_rm(rc, neh);
else
Expand Down

0 comments on commit a0a3631

Please sign in to comment.