From: Rasesh Mody <rasesh.mody@cavium.com>
To: dev@dpdk.org
Cc: Shahed Shaikh <shahed.shaikh@cavium.com>,
ferruh.yigit@intel.com, Dept-EngDPDKDev@cavium.com
Subject: [dpdk-dev] [PATCH 10/11] net/qede: add check for null return value
Date: Sat, 27 Jan 2018 13:15:34 -0800 [thread overview]
Message-ID: <1517087735-16191-11-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1517087735-16191-1-git-send-email-rasesh.mody@cavium.com>
From: Shahed Shaikh <shahed.shaikh@cavium.com>
Test the return value of ecore_ptt_acquire for NULL.
Fixes: d378cefab84e ("net/qede: add support for GENEVE tunneling offload")
Coverity issue: 257049
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
---
drivers/net/qede/qede_ethdev.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index cab5059..c3cea6d 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -681,7 +681,16 @@ static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast)
for_each_hwfn(edev, i) {
p_hwfn = &edev->hwfns[i];
- p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL;
+ if (IS_PF(edev)) {
+ p_ptt = ecore_ptt_acquire(p_hwfn);
+ if (!p_ptt) {
+ DP_ERR(p_hwfn, "Can't acquire PTT\n");
+ return -EAGAIN;
+ }
+ } else {
+ p_ptt = NULL;
+ }
+
rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt,
tunn_info, ECORE_SPQ_MODE_CB, NULL);
if (IS_PF(edev))
--
1.7.10.3
next prev parent reply other threads:[~2018-01-27 21:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-27 21:15 [dpdk-dev] [PATCH 00/11] net/qede: update PMD version to 2.7.0.1 Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 01/11] net/qede/base: fix VF LRO tunnel params configuration Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 02/11] net/qede: initialize VF tunnel as enabled on start Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 03/11] net/qede: fix to check if tunnel L3 header is valid Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 04/11] net/qede: fix tunnel header size in Tx BD configuration Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 05/11] net/qede: remove DEBUG INFO config option Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 06/11] net/qede: fix MTU set and max Rx pkt len usage Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 07/11] net/qede: fix clearing of queue stats Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 08/11] doc: update qede guide Rasesh Mody
2018-01-27 21:15 ` [dpdk-dev] [PATCH 09/11] doc: update bnx2x guide Rasesh Mody
2018-01-27 21:15 ` Rasesh Mody [this message]
2018-01-27 21:15 ` [dpdk-dev] [PATCH 11/11] net/qede: update PMD version Rasesh Mody
2018-01-29 10:15 ` [dpdk-dev] [PATCH 00/11] net/qede: update PMD version to 2.7.0.1 Ferruh Yigit
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=1517087735-16191-11-git-send-email-rasesh.mody@cavium.com \
--to=rasesh.mody@cavium.com \
--cc=Dept-EngDPDKDev@cavium.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=shahed.shaikh@cavium.com \
/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).