DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ipn3ke: check input arguement before other operation
@ 2019-05-22  7:21 Andy Pei
  2019-05-23  2:30 ` Xu, Rosen
  2019-05-23  2:53 ` [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument " Andy Pei
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Pei @ 2019-05-22  7:21 UTC (permalink / raw)
  To: dev; +Cc: andy.pei, rosen.xu, stable

check input arguement 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@intel.com
Cc: stable@dpdk.org

Signed-off-by: Andy Pei <andy.pei@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..32d4fc8 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 = NULL;
+	struct ipn3ke_rpst *rpst = NULL;
 
 	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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ipn3ke: check input arguement before other operation
  2019-05-22  7:21 [dpdk-dev] [PATCH] net/ipn3ke: check input arguement before other operation Andy Pei
@ 2019-05-23  2:30 ` Xu, Rosen
  2019-05-23  3:05   ` Pei, Andy
  2019-05-23  2:53 ` [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument " Andy Pei
  1 sibling, 1 reply; 6+ messages in thread
From: Xu, Rosen @ 2019-05-23  2:30 UTC (permalink / raw)
  To: Pei, Andy, dev; +Cc: stable

Hi,

> -----Original Message-----
> From: Pei, Andy
> Sent: Wednesday, May 22, 2019 15:22
> To: dev@dpdk.org
> Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/ipn3ke: check input arguement before other operation
> 
> check input arguement 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@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei@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..32d4fc8 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 = NULL;
> +	struct ipn3ke_rpst *rpst = NULL;

No need to initialize point variable.

>  	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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument before other operation
  2019-05-22  7:21 [dpdk-dev] [PATCH] net/ipn3ke: check input arguement before other operation Andy Pei
  2019-05-23  2:30 ` Xu, Rosen
@ 2019-05-23  2:53 ` Andy Pei
  2019-05-23  2:59   ` Xu, Rosen
  1 sibling, 1 reply; 6+ messages in thread
From: Andy Pei @ 2019-05-23  2:53 UTC (permalink / raw)
  To: dev; +Cc: andy.pei, rosen.xu, stable

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@intel.com
Cc: stable@dpdk.org

Signed-off-by: Andy Pei <andy.pei@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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument before other operation
  2019-05-23  2:53 ` [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument " Andy Pei
@ 2019-05-23  2:59   ` Xu, Rosen
  2019-06-18 13:31     ` Zhang, Qi Z
  0 siblings, 1 reply; 6+ messages in thread
From: Xu, Rosen @ 2019-05-23  2:59 UTC (permalink / raw)
  To: Pei, Andy, dev; +Cc: stable

Hi,

> -----Original Message-----
> From: Pei, Andy
> Sent: Thursday, May 23, 2019 10:53
> To: dev@dpdk.org
> Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> stable@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@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei@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@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ipn3ke: check input arguement before other operation
  2019-05-23  2:30 ` Xu, Rosen
@ 2019-05-23  3:05   ` Pei, Andy
  0 siblings, 0 replies; 6+ messages in thread
From: Pei, Andy @ 2019-05-23  3:05 UTC (permalink / raw)
  To: Xu, Rosen, dev; +Cc: stable

Hi, Rosen,

It will be fixed in v2.

-----Original Message-----
From: Xu, Rosen 
Sent: Thursday, May 23, 2019 10:31 AM
To: Pei, Andy <andy.pei@intel.com>; dev@dpdk.org
Cc: stable@dpdk.org
Subject: RE: [PATCH] net/ipn3ke: check input arguement before other operation

Hi,

> -----Original Message-----
> From: Pei, Andy
> Sent: Wednesday, May 22, 2019 15:22
> To: dev@dpdk.org
> Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>; 
> stable@dpdk.org
> Subject: [PATCH] net/ipn3ke: check input arguement before other 
> operation
> 
> check input arguement 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@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei@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..32d4fc8 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 = NULL;
> +	struct ipn3ke_rpst *rpst = NULL;

No need to initialize point variable.

>  	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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument before other operation
  2019-05-23  2:59   ` Xu, Rosen
@ 2019-06-18 13:31     ` Zhang, Qi Z
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2019-06-18 13:31 UTC (permalink / raw)
  To: Xu, Rosen, Pei, Andy, dev; +Cc: stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xu, Rosen
> Sent: Thursday, May 23, 2019 11:00 AM
> To: Pei, Andy <andy.pei@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument before
> other operation
> 
> Hi,
> 
> > -----Original Message-----
> > From: Pei, Andy
> > Sent: Thursday, May 23, 2019 10:53
> > To: dev@dpdk.org
> > Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> > stable@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@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Andy Pei <andy.pei@intel.com>
> > ---
> Acked-by: Rosen Xu <rosen.xu@intel.com>

Applied to dpdk-next-net-intel

Thanks
Qi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-18 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  7:21 [dpdk-dev] [PATCH] net/ipn3ke: check input arguement before other operation Andy Pei
2019-05-23  2:30 ` Xu, Rosen
2019-05-23  3:05   ` Pei, Andy
2019-05-23  2:53 ` [dpdk-dev] [PATCH v2] net/ipn3ke: check input argument " Andy Pei
2019-05-23  2:59   ` Xu, Rosen
2019-06-18 13:31     ` Zhang, Qi Z

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