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

Commit 862bbcaa authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
Browse files

USB: gadget: f_fs: Release endpoint upon disable



Endpoints are claimed using usb_ep_autoconfig function,
It will choose an unclaimed usb_ep and prevent the endpoint
from being returned by a later autoconfig calls. We can mark
the driver_data pointer once ep_enable is done in bind.

If we cannot mark to null upon function disable the corresponding
endpoint is not allocated by a later autoconfig call. The current
code does not make the ep->driver_data to null upon function disable.
This is leading to unclaimed endpoints for later autoconfig calls.
Claim the endpoints by assigning ep->driver_data to NULL.

CRs-Fixed: 633673
Change-Id: I221b98ef36cc2a60d27507a2442061a30ed410f4
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent 38febb2c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1561,8 +1561,10 @@ static void ffs_func_eps_disable(struct ffs_function *func)
	spin_lock_irqsave(&func->ffs->eps_lock, flags);
	do {
		/* pending requests get nuked */
		if (likely(ep->ep))
		if (likely(ep->ep)) {
			usb_ep_disable(ep->ep);
			ep->ep->driver_data = NULL;
		}
		epfile->ep = NULL;

		++ep;