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

Commit f9c56cdd authored by Ido Shayevitz's avatar Ido Shayevitz Committed by Felipe Balbi
Browse files

usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep on disable



This fix a bug in f_serial, which expect the ep->desc to be NULL after
disabling an endpoint.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarIdo Shayevitz <idos@codeaurora.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a003c187
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -440,6 +440,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)

	dep->stream_capable = false;
	dep->desc = NULL;
	dep->endpoint.desc = NULL;
	dep->comp_desc = NULL;
	dep->type = 0;
	dep->flags = 0;
+1 −0
Original line number Diff line number Diff line
@@ -445,6 +445,7 @@ static void ep_init(struct udc_regs __iomem *regs, struct udc_ep *ep)

	VDBG(ep->dev, "ep-%d reset\n", ep->num);
	ep->desc = NULL;
	ep->ep.desc = NULL;
	ep->ep.ops = &udc_ep_ops;
	INIT_LIST_HEAD(&ep->queue);

+1 −0
Original line number Diff line number Diff line
@@ -557,6 +557,7 @@ static int at91_ep_disable (struct usb_ep * _ep)

	/* restore the endpoint's pristine config */
	ep->desc = NULL;
	ep->ep.desc = NULL;
	ep->ep.maxpacket = ep->maxpacket;

	/* reset fifos and endpoint */
+1 −0
Original line number Diff line number Diff line
@@ -659,6 +659,7 @@ static int usba_ep_disable(struct usb_ep *_ep)
		return -EINVAL;
	}
	ep->desc = NULL;
	ep->ep.desc = NULL;

	list_splice_init(&ep->queue, &req_list);
	if (ep->can_dma) {
+1 −0
Original line number Diff line number Diff line
@@ -2181,6 +2181,7 @@ static int ep_disable(struct usb_ep *ep)
	} while (mEp->dir != direction);

	mEp->desc = NULL;
	mEp->ep.desc = NULL;

	spin_unlock_irqrestore(mEp->lock, flags);
	return retval;
Loading