Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ade5d7e authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi
Browse files

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



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: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent f1c7e710
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -196,7 +196,7 @@ agdev_iso_complete(struct usb_ep *ep, struct usb_request *req)
	struct snd_uac2_chip *uac2 = prm->uac2;
	struct snd_uac2_chip *uac2 = prm->uac2;


	/* i/f shutting down */
	/* i/f shutting down */
	if (!prm->ep_enabled)
	if (!prm->ep_enabled || req->status == -ESHUTDOWN)
		return;
		return;


	/*
	/*