bnx2fc: check IS_ERR() instead of NULL
Subsystems (3)
PATCH 1/2 bnx2fc: check IS_ERR() instead of NULL
The bnx2fc_if_create() function returns NULL on failure, it never returns an error pointer.
Signed-off-by Dan Carpenter <[email protected]>
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1 -1
@@ -1081,7 +1081,7 @@ static int bnx2fc_vport_create(struct fc_vport *vport, bool disabled)mutex_unlock (&bnx2fc_dev_lock);rtnl_unlock (); -if (IS_ERR (vn_port)) { +if (!vn_port) { printk(KERN_ERR PFX "bnx2fc_vport_create (%s) failed\n", netdev->name);return -EIO ;
Looks ok.
Acked-by Chad Dupuis <[email protected]>
Quoted 19 lines · Dan Carpenter
The
bnx2fc_if_create()function returns NULL on failure, it never returns an error pointer.Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1
-1@@ -1081,7 +1081,7 @@ static int bnx2fc_vport_create(struct fc_vport *vport, bool disabled)mutex_unlock (&bnx2fc_dev_lock);rtnl_unlock (); -if (IS_ERR (vn_port)) { +if (!vn_port) { printk(KERN_ERR PFX "bnx2fc_vport_create (%s) failed\n", netdev->name);return -EIO ;
Christoph Hellwig
AppliedThanks,
applied both patches to the drivers-for-3.19 branch.