diff options
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 75a256f3d45b..d623c7bda1f6 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -48,10 +48,9 @@ static int queue_dbg_open(struct inode *inode, struct file *file) | |||
48 | 48 | ||
49 | spin_lock_irq(&ep->udc->lock); | 49 | spin_lock_irq(&ep->udc->lock); |
50 | list_for_each_entry(req, &ep->queue, queue) { | 50 | list_for_each_entry(req, &ep->queue, queue) { |
51 | req_copy = kmalloc(sizeof(*req_copy), GFP_ATOMIC); | 51 | req_copy = kmemdup(req, sizeof(*req_copy), GFP_ATOMIC); |
52 | if (!req_copy) | 52 | if (!req_copy) |
53 | goto fail; | 53 | goto fail; |
54 | memcpy(req_copy, req, sizeof(*req_copy)); | ||
55 | list_add_tail(&req_copy->queue, queue_data); | 54 | list_add_tail(&req_copy->queue, queue_data); |
56 | } | 55 | } |
57 | spin_unlock_irq(&ep->udc->lock); | 56 | spin_unlock_irq(&ep->udc->lock); |