diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-03 21:25:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-05 06:53:42 -0700 |
commit | c800460086d1db3579b747d9297cecd2bbf70119 (patch) | |
tree | f8fafdae158dcea441910cd7c482f1efac4108de | |
parent | 2c099ccbd093ffce056987a227fcc96e6a77b101 (diff) | |
download | linux-c800460086d1db3579b747d9297cecd2bbf70119.tar.bz2 |
qed: Add a missing error code
We should be returning -ENOMEM if qed_mcp_cmd_add_elem() fails. The
current code returns success.
Fixes: 4ed1eea82a21 ("qed: Revise MFW command locking")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_mcp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c index 619eac845028..ff6080df2246 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c @@ -455,8 +455,10 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn, qed_mcp_reread_offsets(p_hwfn, p_ptt); seq_num = ++p_hwfn->mcp_info->drv_mb_seq; p_cmd_elem = qed_mcp_cmd_add_elem(p_hwfn, p_mb_params, seq_num); - if (!p_cmd_elem) + if (!p_cmd_elem) { + rc = -ENOMEM; goto err; + } __qed_mcp_cmd_and_union(p_hwfn, p_ptt, p_mb_params, seq_num); spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock); |