diff options
| author | Baokun Li <[email protected]> | 2021-06-09 15:06:12 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-06-09 11:11:30 +0200 |
| commit | 307462a6f5c5a563ec084bb315f4e0279dfb2026 (patch) | |
| tree | 743a14164a215c5d39ab54bb9d274273775f068f | |
| parent | 2a042767814bd0edf2619f06fecd374e266ea068 (diff) | |
usb: gadget: function: printer: use list_move instead of list_del/list_add
Using list_move() instead of list_del() + list_add().
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Baokun Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/usb/gadget/function/f_printer.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index f47fdc1fa7f1..b5112f6974f2 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -667,8 +667,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) value = usb_ep_queue(dev->in_ep, req, GFP_ATOMIC); spin_lock(&dev->lock); if (value) { - list_del(&req->list); - list_add(&req->list, &dev->tx_reqs); + list_move(&req->list, &dev->tx_reqs); spin_unlock_irqrestore(&dev->lock, flags); mutex_unlock(&dev->lock_printer_io); return -EAGAIN; |