diff options
Diffstat (limited to 'drivers/usb/gadget/function/f_tcm.c')
-rw-r--r-- | drivers/usb/gadget/function/f_tcm.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 35fe3c80cfc0..197f73386fac 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c | |||
@@ -1445,16 +1445,18 @@ static void usbg_drop_tpg(struct se_portal_group *se_tpg) | |||
1445 | for (i = 0; i < TPG_INSTANCES; ++i) | 1445 | for (i = 0; i < TPG_INSTANCES; ++i) |
1446 | if (tpg_instances[i].tpg == tpg) | 1446 | if (tpg_instances[i].tpg == tpg) |
1447 | break; | 1447 | break; |
1448 | if (i < TPG_INSTANCES) | 1448 | if (i < TPG_INSTANCES) { |
1449 | tpg_instances[i].tpg = NULL; | 1449 | tpg_instances[i].tpg = NULL; |
1450 | opts = container_of(tpg_instances[i].func_inst, | 1450 | opts = container_of(tpg_instances[i].func_inst, |
1451 | struct f_tcm_opts, func_inst); | 1451 | struct f_tcm_opts, func_inst); |
1452 | mutex_lock(&opts->dep_lock); | 1452 | mutex_lock(&opts->dep_lock); |
1453 | if (opts->has_dep) | 1453 | if (opts->has_dep) |
1454 | module_put(opts->dependent); | 1454 | module_put(opts->dependent); |
1455 | else | 1455 | else |
1456 | configfs_undepend_item_unlocked(&opts->func_inst.group.cg_item); | 1456 | configfs_undepend_item_unlocked( |
1457 | mutex_unlock(&opts->dep_lock); | 1457 | &opts->func_inst.group.cg_item); |
1458 | mutex_unlock(&opts->dep_lock); | ||
1459 | } | ||
1458 | mutex_unlock(&tpg_instances_lock); | 1460 | mutex_unlock(&tpg_instances_lock); |
1459 | 1461 | ||
1460 | kfree(tpg); | 1462 | kfree(tpg); |