Commit be2fe2ed authored by Dan Carpenter's avatar Dan Carpenter Committed by Juerg Haefliger

scsi: bnx2fc: Fix NULL dereference in error handling

BugLink: https://bugs.launchpad.net/bugs/1811647

[ Upstream commit 9ae4f842 ]

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

Fixes: aea71a02 ("[SCSI] bnx2fc: Introduce interface structure for each vlan interface")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent cb2e659c
...@@ -2279,7 +2279,7 @@ static int _bnx2fc_create(struct net_device *netdev, ...@@ -2279,7 +2279,7 @@ static int _bnx2fc_create(struct net_device *netdev,
if (!interface) { if (!interface) {
printk(KERN_ERR PFX "bnx2fc_interface_create failed\n"); printk(KERN_ERR PFX "bnx2fc_interface_create failed\n");
rc = -ENOMEM; rc = -ENOMEM;
goto ifput_err; goto netdev_err;
} }
if (netdev->priv_flags & IFF_802_1Q_VLAN) { if (netdev->priv_flags & IFF_802_1Q_VLAN) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment