summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function
diff options
context:
space:
mode:
authorVijayavardhan Vennapusa <vvreddy@codeaurora.org>2016-01-28 10:16:56 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:09:59 -0700
commit61c08e8af679f15b5bfb9fc4e79738c815190e63 (patch)
treee3cd9b08ecc528c40eb697252b6338d2f969a952 /drivers/usb/gadget/function
parented7d0b670da1c3d3a210bb5dc9f9042fc424ee38 (diff)
USB: f_fs: Set ffs->func to NULL after disabling endpoint in set_alt()
When adb root is performed, userspace will close and open ffs_epsfile. Closing this file will call ffs_functionfs_callback() which does call remove_config(). This will call ffs_function_eps_disable to disable endpoints and then calls ffs_func_unbind(). Unbind() will also call endpoint disable which might lead to disabling endpoint which is already disabled. Some of UDC driver throws WARN_ON() if same endpoint is being disabled multiple time. Hence set ffs->func to NULL after disabling endpoints in set_alt() to overcome WARN_ON(). Change-Id: I3052bdee74a1793d4e003de4b991d353e5d699b0 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org> Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'drivers/usb/gadget/function')
-rw-r--r--drivers/usb/gadget/function/f_fs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index cf43e9e18368..214c19de2589 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -2933,8 +2933,10 @@ static int ffs_func_set_alt(struct usb_function *f,
return intf;
}
- if (ffs->func)
+ if (ffs->func) {
ffs_func_eps_disable(ffs->func);
+ ffs->func = NULL;
+ }
if (ffs->state == FFS_DEACTIVATED) {
ffs->state = FFS_CLOSING;