Commit a1f79504 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman

usb: host: xen-hcd: add missing unlock in error path

Add the missing unlock before return from function xenhcd_urb_request_done()
and xenhcd_conn_notify() in the error handling case.

Fixes: 494ed399 ("usb: Introduce Xen pvUSB frontend (xen hcd)")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211215035805.375244-1-yangyingliang@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5b5b45f
......@@ -942,6 +942,7 @@ static int xenhcd_urb_request_done(struct xenhcd_info *info)
rp = info->urb_ring.sring->rsp_prod;
if (RING_RESPONSE_PROD_OVERFLOW(&info->urb_ring, rp)) {
xenhcd_set_error(info, "Illegal index on urb-ring");
spin_unlock_irqrestore(&info->lock, flags);
return 0;
}
rmb(); /* ensure we see queued responses up to "rp" */
......@@ -997,6 +998,7 @@ static int xenhcd_conn_notify(struct xenhcd_info *info)
rp = info->conn_ring.sring->rsp_prod;
if (RING_RESPONSE_PROD_OVERFLOW(&info->conn_ring, rp)) {
xenhcd_set_error(info, "Illegal index on conn-ring");
spin_unlock_irqrestore(&info->lock, flags);
return 0;
}
rmb(); /* ensure we see queued responses up to "rp" */
......@@ -1010,6 +1012,7 @@ static int xenhcd_conn_notify(struct xenhcd_info *info)
if (xenhcd_rhport_connect(info, portnum, speed)) {
xenhcd_set_error(info, "Illegal data on conn-ring");
spin_unlock_irqrestore(&info->lock, flags);
return 0;
}
......
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