rpmsg: unlock on error in rpmsg_eptdev_read()
Subsystems (2)
PATCH 1/1 rpmsg: unlock on error in rpmsg_eptdev_read()
We should unlock before returning if skb_dequeue() returns a NULL.
Fixes c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface")
Signed-off-by Dan Carpenter <[email protected]>
drivers/rpmsg/rpmsg_char.c +1 -2
@@ -209,11 +209,10 @@ static ssize_t rpmsg_eptdev_read(struct file *filp, char __user *buf, } skb =skb_dequeue (&eptdev->queue); +spin_unlock_irqrestore (&eptdev->queue_lock, flags);if (!skb)return -EFAULT ; -spin_unlock_irqrestore (&eptdev->queue_lock, flags); - use =min_t (size_t, len, skb->len);if (copy_to_user (buf, skb->data, use)) use = -EFAULT ;