summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_tcm.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-08-01 17:34:01 (GMT)
committerBjorn Helgaas <bhelgaas@google.com>2016-08-01 17:34:01 (GMT)
commit9454c23852ca6d7aec89fd6fd46a046c323caac3 (patch)
tree794be65345027b5adea3720a43124fee338333a5 /drivers/usb/gadget/function/f_tcm.c
parenta04bee8285a71cdbb9076c3dc38be1f0b9a6b4b3 (diff)
parent4ef33685aa0957d771e068b60a5f3ca6b47ade1c (diff)
downloadlinux-9454c23852ca6d7aec89fd6fd46a046c323caac3.tar.xz
Merge branch 'pci/msi-affinity' into next
Conflicts: drivers/nvme/host/pci.c
Diffstat (limited to 'drivers/usb/gadget/function/f_tcm.c')
-rw-r--r--drivers/usb/gadget/function/f_tcm.c20
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 35fe3c8..197f733 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)
for (i = 0; i < TPG_INSTANCES; ++i)
if (tpg_instances[i].tpg == tpg)
break;
- if (i < TPG_INSTANCES)
+ if (i < TPG_INSTANCES) {
tpg_instances[i].tpg = NULL;
- opts = container_of(tpg_instances[i].func_inst,
- struct f_tcm_opts, func_inst);
- mutex_lock(&opts->dep_lock);
- if (opts->has_dep)
- module_put(opts->dependent);
- else
- configfs_undepend_item_unlocked(&opts->func_inst.group.cg_item);
- mutex_unlock(&opts->dep_lock);
+ opts = container_of(tpg_instances[i].func_inst,
+ struct f_tcm_opts, func_inst);
+ mutex_lock(&opts->dep_lock);
+ if (opts->has_dep)
+ module_put(opts->dependent);
+ else
+ configfs_undepend_item_unlocked(
+ &opts->func_inst.group.cg_item);
+ mutex_unlock(&opts->dep_lock);
+ }
mutex_unlock(&tpg_instances_lock);
kfree(tpg);