diff options
Diffstat (limited to 'drivers/usb/core/urb.c')
| -rw-r--r-- | drivers/usb/core/urb.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 30727729a44c..33d62d7e3929 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -715,6 +715,12 @@ void usb_kill_urb(struct urb *urb)  	if (!(urb && urb->dev && urb->ep))  		return;  	atomic_inc(&urb->reject); +	/* +	 * Order the write of urb->reject above before the read +	 * of urb->use_count below.  Pairs with the barriers in +	 * __usb_hcd_giveback_urb() and usb_hcd_submit_urb(). +	 */ +	smp_mb__after_atomic();  	usb_hcd_unlink_urb(urb, -ENOENT);  	wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0); @@ -756,6 +762,12 @@ void usb_poison_urb(struct urb *urb)  	if (!urb)  		return;  	atomic_inc(&urb->reject); +	/* +	 * Order the write of urb->reject above before the read +	 * of urb->use_count below.  Pairs with the barriers in +	 * __usb_hcd_giveback_urb() and usb_hcd_submit_urb(). +	 */ +	smp_mb__after_atomic();  	if (!urb->dev || !urb->ep)  		return;  |