From: Murphy Yang <murphyx.yang@intel.com>
To: dev@dpdk.org
Cc: qiming.yang@intel.com, ferruh.yigit@intel.com, jia.guo@intel.com,
beilei.xing@intel.com, stevex.yang@intel.com,
Murphy Yang <murphyx.yang@intel.com>
Subject: [dpdk-dev] [PATCH] net/i40e: i40e PMD APIs add input pointer null check
Date: Fri, 8 Jan 2021 08:30:11 +0000 [thread overview]
Message-ID: <20210108083011.28700-1-murphyx.yang@intel.com> (raw)
Pointer 'NULL' check for 'mac_addr' or 'conf' within i40e PMD APIs.
Fixes: 66c78f4799ff ("net/i40e: add support for packet template to flow director")
Fixes: 04b443fb2c43 ("net/i40e: fix port id type")
Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
---
drivers/net/i40e/rte_pmd_i40e.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 790d042002..2e34140c5b 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2366,6 +2366,9 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
struct i40e_mac_filter_info mac_filter;
int ret;
+ if (mac_addr == NULL)
+ return -EINVAL;
+
if (i40e_validate_mac_addr((u8 *)mac_addr) != I40E_SUCCESS)
return -EINVAL;
@@ -3042,6 +3045,9 @@ int rte_pmd_i40e_flow_add_del_packet_template(
RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+ if (conf == NULL)
+ return -EINVAL;
+
if (!is_i40e_supported(dev))
return -ENOTSUP;
--
2.17.1
next reply other threads:[~2021-01-08 8:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 8:30 Murphy Yang [this message]
2021-01-13 3:42 ` 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=20210108083011.28700-1-murphyx.yang@intel.com \
--to=murphyx.yang@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jia.guo@intel.com \
--cc=qiming.yang@intel.com \
--cc=stevex.yang@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).