Commit de06875f authored by Andy Grover's avatar Andy Grover Committed by Nicholas Bellinger

target: Remove extra percpu_ref_init

lun->lun_ref is also initialized in core_tpg_post_addlun, so it doesn't
need to be done in core_tpg_setup_virtual_lun0.

(nab: Drop left-over percpu_ref_cancel_init in failure path)
Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 95cadace
...@@ -656,15 +656,9 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) ...@@ -656,15 +656,9 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg)
spin_lock_init(&lun->lun_sep_lock); spin_lock_init(&lun->lun_sep_lock);
init_completion(&lun->lun_ref_comp); init_completion(&lun->lun_ref_comp);
ret = percpu_ref_init(&lun->lun_ref, core_tpg_lun_ref_release);
if (ret < 0)
return ret;
ret = core_tpg_post_addlun(se_tpg, lun, lun_access, dev); ret = core_tpg_post_addlun(se_tpg, lun, lun_access, dev);
if (ret < 0) { if (ret < 0)
percpu_ref_cancel_init(&lun->lun_ref);
return ret; return ret;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment