fcoe: add missing destroy_workqueue() on error in fcoe_init()
authorWei Yongjun <weiyj.lk@gmail.com>
Fri, 29 Jul 2016 15:54:48 +0000 (15:54 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 2 Aug 2016 05:18:05 +0000 (01:18 -0400)
Add the missing destroy_workqueue() before return from fcoe_init() in
the fcoe transport register failed error handling case.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fcoe/fcoe.c

index 197dc62..9bd41a3 100644 (file)
@@ -2495,7 +2495,7 @@ static int __init fcoe_init(void)
        if (rc) {
                printk(KERN_ERR "failed to register an fcoe transport, check "
                        "if libfcoe is loaded\n");
-               return rc;
+               goto out_destroy;
        }
 
        mutex_lock(&fcoe_config_mutex);
@@ -2518,6 +2518,7 @@ static int __init fcoe_init(void)
 
 out_free:
        mutex_unlock(&fcoe_config_mutex);
+out_destroy:
        destroy_workqueue(fcoe_wq);
        return rc;
 }