From: Dan Carpenter <dan.carpenter@oracle.com>
To: Yuval Mintz <Yuval.Mintz@cavium.com>,
Tomer Tayar <Tomer.Tayar@cavium.com>
Cc: Ariel Elior <Ariel.Elior@cavium.com>,
everest-linux-l2@cavium.com, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH -next] qed: Add a missing error code
Date: Mon, 3 Apr 2017 21:25:22 +0300 [thread overview]
Message-ID: <20170403182522.GA32592@mwanda> (raw)
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>
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);
next reply other threads:[~2017-04-03 18:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 18:25 Dan Carpenter [this message]
2017-04-04 6:13 ` [PATCH -next] qed: Add a missing error code Tayar, Tomer
2017-04-05 13:54 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170403182522.GA32592@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Ariel.Elior@cavium.com \
--cc=Tomer.Tayar@cavium.com \
--cc=Yuval.Mintz@cavium.com \
--cc=everest-linux-l2@cavium.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).