Skip to content

Commit

Permalink
bnx2x: fix an error code in bnx2x_nic_load()
Browse files Browse the repository at this point in the history
[ Upstream commit fb65382 ]

Set the error code if bnx2x_alloc_fw_stats_mem() fails.  The current
code returns success.

Fixes: ad5afc8 ("bnx2x: Separate VF and PF logic")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Aug 12, 2021
1 parent 9884f60 commit 6e2de0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 6e2de0a

Please sign in to comment.