From: Murphy Yang Date: Fri, 8 Jan 2021 08:30:11 +0000 (+0000) Subject: net/i40e: add null input checks X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=696ad314ccfcd708534aeaefbd946f872278e023;p=dpdk.git net/i40e: add null input checks 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") Cc: stable@dpdk.org Signed-off-by: Murphy Yang Acked-by: Qi Zhang --- 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;