Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
net/i40e: add null input checks
[ upstream commit 696ad31 ]

Pointer 'NULL' check for 'mac_addr' or 'conf' within i40e PMD APIs.

Fixes: 66c78f4 ("net/i40e: add support for packet template to flow director")
Fixes: 04b443f ("net/i40e: fix port id type")

Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Murphy Yang authored and bluca committed Feb 2, 2021
1 parent d2475d6 commit 920206b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/i40e/rte_pmd_i40e.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 920206b

Please sign in to comment.