From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 4 Nov 2014 10:37:59 +0000 (+0300)
Subject: bnx2fc: fix an error code in _bnx2fc_create()
X-Git-Tag: firefly_0821_release~176^2~2603^2^2~117
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2043e1fd09c1896bb03a6e25b64baa84a30879c9;p=firefly-linux-kernel-4.4.55.git

bnx2fc: fix an error code in _bnx2fc_create()

We should be returning an error code here instead of success.  Either
-ENODEV or -ENOMEM would work.  There is also a failure message in
printk().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index b0d7256997ac..2262c75f45d8 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2195,6 +2195,7 @@ static int _bnx2fc_create(struct net_device *netdev,
 	interface = bnx2fc_interface_create(hba, netdev, fip_mode);
 	if (!interface) {
 		printk(KERN_ERR PFX "bnx2fc_interface_create failed\n");
+		rc = -ENOMEM;
 		goto ifput_err;
 	}