bnx2fc: check IS_ERR() instead of NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 4 Nov 2014 10:37:17 +0000 (13:37 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2014 11:05:25 +0000 (12:05 +0100)
The bnx2fc_if_create() function returns NULL on failure, it never
returns an error pointer.

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>
drivers/scsi/bnx2fc/bnx2fc_fcoe.c

index cd2e6102592608636a92f7a21738ec7c987abe92..b0d7256997ac9cdbece03c3726b8b4c573aa7e60 100644 (file)
@@ -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;