diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-11-01 08:25:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-13 12:00:57 +0300 |
commit | bbed2ced931009ba45ff32e8abdef8523548fd9b (patch) | |
tree | e87a92dab714ac6f8bbf35a16f2e2926d3e1c9db | |
parent | 5ac1f046ab4a6f629a524b9bd4f15f72bf6a4798 (diff) | |
download | linux-bbed2ced931009ba45ff32e8abdef8523548fd9b.tar.xz |
scsi: bnx2fc: Fix NULL dereference in error handling
[ Upstream commit 9ae4f8420ed7be4b13c96600e3568c144d101a23 ]
If "interface" is NULL then we can't release it and trying to will only
lead to an Oops.
Fixes: aea71a024914 ("[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 6844ba361616..89f09b122135 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -2372,7 +2372,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)) { |