summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-08-05 13:38:26 +0300
committerDavid S. Miller <davem@davemloft.net>2021-08-05 15:32:10 +0300
commitfb653827c758725b149b5c924a5eb50ab4812750 (patch)
treedb15aa9d154472127baf9ddb3a2ace0e23fa6500 /drivers/net
parentafa00d3f5800a83228311636fc69fd28fb7af205 (diff)
downloadlinux-fb653827c758725b149b5c924a5eb50ab4812750.tar.xz
bnx2x: fix an error code in bnx2x_nic_load()
Set the error code if bnx2x_alloc_fw_stats_mem() fails. The current code returns success. Fixes: ad5afc89365e ("bnx2x: Separate VF and PF logic") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 1a6ec1a12d53..b5d954cb409a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2669,7 +2669,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
}
/* Allocated memory for FW statistics */
- if (bnx2x_alloc_fw_stats_mem(bp))
+ rc = bnx2x_alloc_fw_stats_mem(bp);
+ if (rc)
LOAD_ERROR_EXIT(bp, load_error0);
/* request pf to initialize status blocks */