aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_fs.c')
-rw-r--r--drivers/usb/gadget/f_fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 1cbba70836bc..f52cb1ae45d9 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -712,7 +712,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
712 if (code == FUNCTIONFS_INTERFACE_REVMAP) { 712 if (code == FUNCTIONFS_INTERFACE_REVMAP) {
713 struct ffs_function *func = ffs->func; 713 struct ffs_function *func = ffs->func;
714 ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV; 714 ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
715 } else if (gadget->ops->ioctl) { 715 } else if (gadget && gadget->ops->ioctl) {
716 ret = gadget->ops->ioctl(gadget, code, value); 716 ret = gadget->ops->ioctl(gadget, code, value);
717 } else { 717 } else {
718 ret = -ENOTTY; 718 ret = -ENOTTY;
@@ -1382,6 +1382,7 @@ static void functionfs_unbind(struct ffs_data *ffs)
1382 ffs->ep0req = NULL; 1382 ffs->ep0req = NULL;
1383 ffs->gadget = NULL; 1383 ffs->gadget = NULL;
1384 ffs_data_put(ffs); 1384 ffs_data_put(ffs);
1385 clear_bit(FFS_FL_BOUND, &ffs->flags);
1385 } 1386 }
1386} 1387}
1387 1388