Skip to contentSkip to conversation

bnx2fc: fix an error code in _bnx2fc_create()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 4, 2014 – Nov 5, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 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().

drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1 -0
index dfed4be..251b114 100644
@@ -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;
 	}
 
Acked-by on v1 2/2
#1 lore raw

Looks ok.

Quoted 19 lines · Dan Carpenter

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().

drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1 -0
index dfed4be..251b114 100644
@@ -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;
 	}