Commit 307462a6 authored by Baokun Li's avatar Baokun Li Committed by Greg Kroah-Hartman

usb: gadget: function: printer: use list_move instead of list_del/list_add

Using list_move() instead of list_del() + list_add().
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Link: https://lore.kernel.org/r/20210609070612.1325044-1-libaokun1@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2a042767
...@@ -667,8 +667,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) ...@@ -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); value = usb_ep_queue(dev->in_ep, req, GFP_ATOMIC);
spin_lock(&dev->lock); spin_lock(&dev->lock);
if (value) { if (value) {
list_del(&req->list); list_move(&req->list, &dev->tx_reqs);
list_add(&req->list, &dev->tx_reqs);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
mutex_unlock(&dev->lock_printer_io); mutex_unlock(&dev->lock_printer_io);
return -EAGAIN; return -EAGAIN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment