[dpdk-stable] [PATCH v2] net/ipn3ke: check input argument before other operation

Xu, Rosen rosen.xu at intel.com
Thu May 23 04:59:30 CEST 2019


Hi,

> -----Original Message-----
> From: Pei, Andy
> Sent: Thursday, May 23, 2019 10:53
> To: dev at dpdk.org
> Cc: Pei, Andy <andy.pei at intel.com>; Xu, Rosen <rosen.xu at intel.com>;
> stable at dpdk.org
> Subject: [PATCH v2] net/ipn3ke: check input argument before other
> operation
> 
> check input argument rte_eth_dev *ethdev, ensuring ethdev is not NULL
> before operation on ethdev.
> 
> Coverity issue: 337922
> Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor")
> Cc: rosen.xu at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei at intel.com>
> ---
>  drivers/net/ipn3ke/ipn3ke_representor.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> b/drivers/net/ipn3ke/ipn3ke_representor.c
> index cf3b214..f7bb0b4 100644
> --- a/drivers/net/ipn3ke/ipn3ke_representor.c
> +++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> @@ -735,13 +735,16 @@
>  	enum rte_filter_type filter_type, enum rte_filter_op filter_op,
>  	void *arg)
>  {
> -	struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev);
> -	struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev);
>  	int ret = 0;
> +	struct ipn3ke_hw *hw;
> +	struct ipn3ke_rpst *rpst;
> 
>  	if (ethdev == NULL)
>  		return -EINVAL;
> 
> +	hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev);
> +	rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev);
> +
>  	if (hw->acc_flow)
>  		switch (filter_type) {
>  		case RTE_ETH_FILTER_GENERIC:
> --
> 1.8.3.1

Acked-by: Rosen Xu <rosen.xu at intel.com>


More information about the stable mailing list