scsi: bnx2fc: Fix NULL dereference in error handling

If "interface" is NULL then we can't release it and trying to will only
lead to an Oops.

Fixes: aea71a0249 ("[SCSI] bnx2fc: Introduce interface structure for each vlan interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Dan Carpenter 2018-11-01 08:25:30 +03:00 committed by Martin K. Petersen
parent c64a87f951
commit 9ae4f8420e
1 changed files with 1 additions and 1 deletions

View File

@ -2364,7 +2364,7 @@ static int _bnx2fc_create(struct net_device *netdev,
if (!interface) {
printk(KERN_ERR PFX "bnx2fc_interface_create failed\n");
rc = -ENOMEM;
goto ifput_err;
goto netdev_err;
}
if (is_vlan_dev(netdev)) {