From: Kuba Kozak <kubax.kozak@intel.com>
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, deepak.k.jain@intel.com,
michalx.k.jastrzebski@intel.com,
Kuba Kozak <kubax.kozak@intel.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/i40e: fix dereferencing null pointer
Date: Thu, 27 Jul 2017 09:28:22 +0200 [thread overview]
Message-ID: <1501140502-155485-1-git-send-email-kubax.kozak@intel.com> (raw)
Add check if o_vlan_mask and i_vlan_mask are
not a NULL pointer.
Coverity issue: 143448
Coverity issue: 143449
Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")
Cc: stable@dpdk.org
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
---
drivers/net/i40e/i40e_flow.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 95af701..b92719a 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -3719,8 +3719,10 @@ i40e_flow_parse_qinq_pattern(__rte_unused struct rte_eth_dev *dev,
}
/* Get filter specification */
- if ((o_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK)) &&
- (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
+ if ((o_vlan_mask != NULL) && (o_vlan_mask->tci ==
+ rte_cpu_to_be_16(I40E_TCI_MASK)) &&
+ (i_vlan_mask != NULL) &&
+ (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci)
& I40E_TCI_MASK;
filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci)
--
2.7.4
next reply other threads:[~2017-07-27 7:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 7:28 Kuba Kozak [this message]
2017-07-28 3:29 ` Wu, Jingjing
2017-07-31 13:23 ` [dpdk-dev] [dpdk-stable] " 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=1501140502-155485-1-git-send-email-kubax.kozak@intel.com \
--to=kubax.kozak@intel.com \
--cc=deepak.k.jain@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=michalx.k.jastrzebski@intel.com \
--cc=stable@dpdk.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).