Skip to contentSkip to conversation

net/i40e: i40e PMD APIs add input pointer null check

PATCH Applied Murphy Yang 2 participants 2 messages Jan 8, 2021 – Jan 13, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e: i40e PMD APIs add input pointer null check

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")
---
 drivers/net/i40e/rte_pmd_i40e.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/i40e/rte_pmd_i40e.c +6 -0
index 790d042002..2e34140c5b 100644
@@ -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;
 
Signature · 1 line
2.17.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Murphy Yang
Sent: Friday, January 8, 2021 4:30 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Yang, SteveX <[email protected]>; Yang, MurphyX <[email protected]>
Subject: [dpdk-dev] [PATCH] net/i40e: i40e PMD APIs add input pointer null check

Changed title to "add input pointer null"

Quoted 8 lines

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")

Applied to dpdk-next-net-intel.

Thanks
Qi