From: Xiaolong Ye <xiaolong.ye@intel.com>
To: Qiming Yang <qiming.yang@intel.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: dev@dpdk.org, Xiaolong Ye <xiaolong.ye@intel.com>, ying.a.wang@intel.com
Subject: [dpdk-dev] [PATCH v2] net/ice: fix potential null pointer dereferences
Date: Mon, 5 Aug 2019 17:15:11 +0800 [thread overview]
Message-ID: <20190805091511.64965-1-xiaolong.ye@intel.com> (raw)
In-Reply-To: <â20190805073923.62812-1-xiaolong.ye@intel.comâ>
This patch fixes two null pointer dereferences in flow code detected by
coverity scan.
Coverity issue: 345815, 345816
Fixes: 94f00800d78b ("net/ice: fix VXLAN/NVGRE flow matching")
Cc: ying.a.wang@intel.com
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
v2 change:
- add coverity ids
drivers/net/ice/ice_generic_flow.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 5fcf4289c..1c0adc779 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -464,7 +464,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[],
"Invalid VXLAN item");
return 0;
}
- if (vxlan_mask->vni[0] == UINT8_MAX &&
+ if (vxlan_mask && vxlan_mask->vni[0] == UINT8_MAX &&
vxlan_mask->vni[1] == UINT8_MAX &&
vxlan_mask->vni[2] == UINT8_MAX)
input_set |= ICE_INSET_TUN_ID;
@@ -486,7 +486,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[],
"Invalid NVGRE item");
return 0;
}
- if (nvgre_mask->tni[0] == UINT8_MAX &&
+ if (nvgre_mask && nvgre_mask->tni[0] == UINT8_MAX &&
nvgre_mask->tni[1] == UINT8_MAX &&
nvgre_mask->tni[2] == UINT8_MAX)
input_set |= ICE_INSET_TUN_ID;
--
2.17.1
next parent reply other threads:[~2019-08-05 9:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <â20190805073923.62812-1-xiaolong.ye@intel.comâ>
2019-08-05 9:15 ` Xiaolong Ye [this message]
2019-08-06 11:13 ` Zhang, Qi Z
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=20190805091511.64965-1-xiaolong.ye@intel.com \
--to=xiaolong.ye@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@intel.com \
--cc=wenzhuo.lu@intel.com \
--cc=ying.a.wang@intel.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).