Merge branch 'x86-cpufeature-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / drivers / target / target_core_tpg.c
index c036595..fddfae6 100644 (file)
@@ -825,7 +825,7 @@ int core_tpg_add_lun(
 
        ret = core_dev_export(dev, tpg, lun);
        if (ret < 0) {
-               percpu_ref_cancel_init(&lun->lun_ref);
+               percpu_ref_exit(&lun->lun_ref);
                return ret;
        }
 
@@ -880,5 +880,7 @@ int core_tpg_post_dellun(
        lun->lun_status = TRANSPORT_LUN_STATUS_FREE;
        spin_unlock(&tpg->tpg_lun_lock);
 
+       percpu_ref_exit(&lun->lun_ref);
+
        return 0;
 }