diff options
| author | James Morris <james.l.morris@oracle.com> | 2012-05-04 12:46:40 +1000 | 
|---|---|---|
| committer | James Morris <james.l.morris@oracle.com> | 2012-05-04 12:46:40 +1000 | 
| commit | 898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3 (patch) | |
| tree | e6e666085abe674dbf6292555961fe0a0f2e2d2f /drivers/uwb/neh.c | |
| parent | 08162e6a23d476544adfe1164afe9ea8b34ab859 (diff) | |
| parent | 69964ea4c7b68c9399f7977aa5b9aa6539a6a98a (diff) | |
| download | olio-linux-3.10-898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3.tar.xz olio-linux-3.10-898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3.zip  | |
Merge tag 'v3.4-rc5' into next
Linux 3.4-rc5
Merge to pull in prerequisite change for Smack:
86812bb0de1a3758dc6c7aa01a763158a7c0638a
Requested by Casey.
Diffstat (limited to 'drivers/uwb/neh.c')
| -rw-r--r-- | drivers/uwb/neh.c | 12 | 
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/uwb/neh.c b/drivers/uwb/neh.c index a269937be1b..8cb71bb333c 100644 --- a/drivers/uwb/neh.c +++ b/drivers/uwb/neh.c @@ -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; @@ -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); @@ -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", @@ -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  |