[PATCH] usb: gadget: f_uac2: don't queue new requests when shutting down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In some circumstances when g_audio is being unloaded there happens
an endless loop in udc driver. It has happend on a board with
s3c-hsotg. If there are requests in endpoint's queue, they are completed
in a loop. But completing them might cause appending new requests
to the queue. This patch causes agdev_iso_complete() to return immediately
if request's status is -ESHUTDOWN. If it does not return immediately,
then although the current request is removed from the queue, a new one
is appended to the queue, so the above mentioned loop cannot end.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
---
 drivers/usb/gadget/f_uac2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c
index d74a4f0..f0ffd71 100644
--- a/drivers/usb/gadget/f_uac2.c
+++ b/drivers/usb/gadget/f_uac2.c
@@ -194,7 +194,7 @@ agdev_iso_complete(struct usb_ep *ep, struct usb_request *req)
 	struct snd_uac2_chip *uac2 = prm->uac2;
 
 	/* i/f shutting down */
-	if (!prm->ep_enabled)
+	if (!prm->ep_enabled || req->status == -ESHUTDOWN)
 		return;
 
 	/*
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux