aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/f_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/f_fs.c')
-rw-r--r--drivers/usb/gadget/function/f_fs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index aab3fc1dbb94..5e746adc8a2d 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -2091,8 +2091,8 @@ static int __ffs_data_do_entity(enum ffs_entity_type type,
2091 2091
2092 case FFS_STRING: 2092 case FFS_STRING:
2093 /* 2093 /*
2094 * Strings are indexed from 1 (0 is magic ;) reserved 2094 * Strings are indexed from 1 (0 is reserved
2095 * for languages list or some such) 2095 * for languages list)
2096 */ 2096 */
2097 if (*valuep > helper->ffs->strings_count) 2097 if (*valuep > helper->ffs->strings_count)
2098 helper->ffs->strings_count = *valuep; 2098 helper->ffs->strings_count = *valuep;
@@ -2252,7 +2252,7 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
2252 2252
2253 if (len < sizeof(*d) || 2253 if (len < sizeof(*d) ||
2254 d->bFirstInterfaceNumber >= ffs->interfaces_count || 2254 d->bFirstInterfaceNumber >= ffs->interfaces_count ||
2255 !d->Reserved1) 2255 d->Reserved1)
2256 return -EINVAL; 2256 return -EINVAL;
2257 for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i) 2257 for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i)
2258 if (d->Reserved2[i]) 2258 if (d->Reserved2[i])
@@ -3666,6 +3666,7 @@ static void ffs_closed(struct ffs_data *ffs)
3666{ 3666{
3667 struct ffs_dev *ffs_obj; 3667 struct ffs_dev *ffs_obj;
3668 struct f_fs_opts *opts; 3668 struct f_fs_opts *opts;
3669 struct config_item *ci;
3669 3670
3670 ENTER(); 3671 ENTER();
3671 ffs_dev_lock(); 3672 ffs_dev_lock();
@@ -3689,8 +3690,11 @@ static void ffs_closed(struct ffs_data *ffs)
3689 || !atomic_read(&opts->func_inst.group.cg_item.ci_kref.refcount)) 3690 || !atomic_read(&opts->func_inst.group.cg_item.ci_kref.refcount))
3690 goto done; 3691 goto done;
3691 3692
3692 unregister_gadget_item(ffs_obj->opts-> 3693 ci = opts->func_inst.group.cg_item.ci_parent->ci_parent;
3693 func_inst.group.cg_item.ci_parent->ci_parent); 3694 ffs_dev_unlock();
3695
3696 unregister_gadget_item(ci);
3697 return;
3694done: 3698done:
3695 ffs_dev_unlock(); 3699 ffs_dev_unlock();
3696} 3700}