Selaa lähdekoodia

[SCSI] libfc: release exchg cache

If fail to create workqueue, the newly created cache for exchg has to be
released.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Reviewed-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Hillf Danton 14 vuotta sitten
vanhempi
commit
6f06e3a7b2
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      drivers/scsi/libfc/fc_exch.c

+ 4 - 1
drivers/scsi/libfc/fc_exch.c

@@ -2465,8 +2465,11 @@ int fc_setup_exch_mgr(void)
 
 	fc_exch_workqueue = create_singlethread_workqueue("fc_exch_workqueue");
 	if (!fc_exch_workqueue)
-		return -ENOMEM;
+		goto err;
 	return 0;
+err:
+	kmem_cache_destroy(fc_em_cachep);
+	return -ENOMEM;
 }
 
 /**