From: John Daley <johndale@cisco.com>
To: ferruh.yigit@intel.com, arybchenko@solarflare.com
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>,
Hyong Youb Kim <hyonkim@cisco.com>
Subject: [PATCH] net/enic: fix dereference before null check
Date: Mon, 14 Feb 2022 12:46:10 -0800 [thread overview]
Message-ID: <20220214204610.14921-1-johndale@cisco.com> (raw)
This patch fixes an issue found by coverity. It checks for a possible
null value of "error" before dereferencing it.
CID: 375064: Dereference after null check
Either the check against null is unnecessary, or there may be a null
pointer dereference.
Coverity issue: 375064
Fixes: ee806eea59fe ("net/enic: support GENEVE flow item")
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
drivers/net/enic/enic_fm_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index f0bda19a70..c87d3af847 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -1204,7 +1204,7 @@ enic_fm_copy_entry(struct enic_flowman *fm,
ret = item_info->copy_item(&args);
if (ret) {
/* If copy_item set the error, return that */
- if (error->type != RTE_FLOW_ERROR_TYPE_NONE)
+ if (error && error->type != RTE_FLOW_ERROR_TYPE_NONE)
return ret;
goto item_not_supported;
}
--
2.33.1
next reply other threads:[~2022-02-14 20:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 20:46 John Daley [this message]
2022-02-15 13:01 ` 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=20220214204610.14921-1-johndale@cisco.com \
--to=johndale@cisco.com \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=hyonkim@cisco.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).