projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1097cce
)
USB: cdc-wdm: updating desc->length must be protected by spin_lock
author
Bjørn Mork
<
[email protected]
>
Mon, 16 Jan 2012 11:41:47 +0000
(12:41 +0100)
committer
Greg Kroah-Hartman
<
[email protected]
>
Tue, 24 Jan 2012 20:17:29 +0000
(12:17 -0800)
wdm_in_callback() will also touch this field, so we cannot change it without locking
Cc:
[email protected]
Signed-off-by: Bjørn Mork <
[email protected]
>
Acked-by: Oliver Neukum <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/class/cdc-wdm.c
patch
|
blob
|
history
diff --git
a/drivers/usb/class/cdc-wdm.c
b/drivers/usb/class/cdc-wdm.c
index 1c50baff7725ec2d8e368b3c34f50925a76f3804..1f6b5c8394b4a9116d7aeb9935fee7683bdea251 100644
(file)
--- a/
drivers/usb/class/cdc-wdm.c
+++ b/
drivers/usb/class/cdc-wdm.c
@@
-467,7
+467,9
@@
retry:
for (i = 0; i < desc->length - cntr; i++)
desc->ubuf[i] = desc->ubuf[i + cntr];
+ spin_lock_irq(&desc->iuspin);
desc->length -= cntr;
+ spin_unlock_irq(&desc->iuspin);
/* in case we had outstanding data */
if (!desc->length)
clear_bit(WDM_READ, &desc->flags);