patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
@ 2020-08-26 13:07 wangyunjian
  2020-10-04 10:41 ` Jerin Jacob
  2020-10-04 10:53 ` Nipun Gupta
  0 siblings, 2 replies; 4+ messages in thread
From: wangyunjian @ 2020-08-26 13:07 UTC (permalink / raw)
  To: dev, hemant.agrawal, nipun.gupta
  Cc: jerry.lilijun, xudingke, Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

Coverity flags that 'portal' variable is used before
it's checked for NULL. This patch fixes this issue.

Coverity issue: 323516
Fixes: 4ab57b042e7c ("event/dpaa2: affine portal at runtime during I/O")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 3ae4441ee..f7383ca73 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -569,14 +569,14 @@ dpaa2_eventdev_port_release(void *port)
 
 	EVENTDEV_INIT_FUNC_TRACE();
 
+	if (portal == NULL)
+		return;
+
 	/* TODO: Cleanup is required when ports are in linked state. */
 	if (portal->is_port_linked)
 		DPAA2_EVENTDEV_WARN("Event port must be unlinked before release");
 
-	if (portal)
-		rte_free(portal);
-
-	portal = NULL;
+	rte_free(portal);
 }
 
 static int
-- 
2.23.0



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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
  2020-08-26 13:07 [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check wangyunjian
@ 2020-10-04 10:41 ` Jerin Jacob
  2020-10-04 10:53 ` Nipun Gupta
  1 sibling, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2020-10-04 10:41 UTC (permalink / raw)
  To: wangyunjian
  Cc: dpdk-dev, Hemant Agrawal, Nipun Gupta, Lilijun (Jerry),
	xudingke, dpdk stable

On Wed, Aug 26, 2020 at 6:37 PM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> Coverity flags that 'portal' variable is used before
> it's checked for NULL. This patch fixes this issue.
>
> Coverity issue: 323516
> Fixes: 4ab57b042e7c ("event/dpaa2: affine portal at runtime during I/O")
> Cc: stable@dpdk.org


dpaa2 maintainers, Please review this.

>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
> index 3ae4441ee..f7383ca73 100644
> --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> @@ -569,14 +569,14 @@ dpaa2_eventdev_port_release(void *port)
>
>         EVENTDEV_INIT_FUNC_TRACE();
>
> +       if (portal == NULL)
> +               return;
> +
>         /* TODO: Cleanup is required when ports are in linked state. */
>         if (portal->is_port_linked)
>                 DPAA2_EVENTDEV_WARN("Event port must be unlinked before release");
>
> -       if (portal)
> -               rte_free(portal);
> -
> -       portal = NULL;
> +       rte_free(portal);
>  }
>
>  static int
> --
> 2.23.0
>
>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
  2020-08-26 13:07 [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check wangyunjian
  2020-10-04 10:41 ` Jerin Jacob
@ 2020-10-04 10:53 ` Nipun Gupta
  2020-10-05  9:40   ` Jerin Jacob
  1 sibling, 1 reply; 4+ messages in thread
From: Nipun Gupta @ 2020-10-04 10:53 UTC (permalink / raw)
  To: wangyunjian, dev, Hemant Agrawal; +Cc: jerry.lilijun, xudingke, stable

Acked-by: Nipun Gupta <nipun.gupta@nxp.com>

> -----Original Message-----
> From: wangyunjian <wangyunjian@huawei.com>
> Sent: Wednesday, August 26, 2020 6:38 PM
> To: dev@dpdk.org; Hemant Agrawal <hemant.agrawal@nxp.com>; Nipun Gupta
> <nipun.gupta@nxp.com>
> Cc: jerry.lilijun@huawei.com; xudingke@huawei.com; Yunjian Wang
> <wangyunjian@huawei.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
> 
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Coverity flags that 'portal' variable is used before
> it's checked for NULL. This patch fixes this issue.
> 
> Coverity issue: 323516
> Fixes: 4ab57b042e7c ("event/dpaa2: affine portal at runtime during I/O")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c
> b/drivers/event/dpaa2/dpaa2_eventdev.c
> index 3ae4441ee..f7383ca73 100644
> --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> @@ -569,14 +569,14 @@ dpaa2_eventdev_port_release(void *port)
> 
>  	EVENTDEV_INIT_FUNC_TRACE();
> 
> +	if (portal == NULL)
> +		return;
> +
>  	/* TODO: Cleanup is required when ports are in linked state. */
>  	if (portal->is_port_linked)
>  		DPAA2_EVENTDEV_WARN("Event port must be unlinked before
> release");
> 
> -	if (portal)
> -		rte_free(portal);
> -
> -	portal = NULL;
> +	rte_free(portal);
>  }
> 
>  static int
> --
> 2.23.0
> 


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
  2020-10-04 10:53 ` Nipun Gupta
@ 2020-10-05  9:40   ` Jerin Jacob
  0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2020-10-05  9:40 UTC (permalink / raw)
  To: Nipun Gupta
  Cc: wangyunjian, dev, Hemant Agrawal, jerry.lilijun, xudingke, stable

On Sun, Oct 4, 2020 at 4:23 PM Nipun Gupta <nipun.gupta@nxp.com> wrote:
>
> Acked-by: Nipun Gupta <nipun.gupta@nxp.com>


Applied to dpdk-next-eventdev/for-main. Thanks.


>
> > -----Original Message-----
> > From: wangyunjian <wangyunjian@huawei.com>
> > Sent: Wednesday, August 26, 2020 6:38 PM
> > To: dev@dpdk.org; Hemant Agrawal <hemant.agrawal@nxp.com>; Nipun Gupta
> > <nipun.gupta@nxp.com>
> > Cc: jerry.lilijun@huawei.com; xudingke@huawei.com; Yunjian Wang
> > <wangyunjian@huawei.com>; stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
> >
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > Coverity flags that 'portal' variable is used before
> > it's checked for NULL. This patch fixes this issue.
> >
> > Coverity issue: 323516
> > Fixes: 4ab57b042e7c ("event/dpaa2: affine portal at runtime during I/O")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> >  drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c
> > b/drivers/event/dpaa2/dpaa2_eventdev.c
> > index 3ae4441ee..f7383ca73 100644
> > --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> > @@ -569,14 +569,14 @@ dpaa2_eventdev_port_release(void *port)
> >
> >       EVENTDEV_INIT_FUNC_TRACE();
> >
> > +     if (portal == NULL)
> > +             return;
> > +
> >       /* TODO: Cleanup is required when ports are in linked state. */
> >       if (portal->is_port_linked)
> >               DPAA2_EVENTDEV_WARN("Event port must be unlinked before
> > release");
> >
> > -     if (portal)
> > -             rte_free(portal);
> > -
> > -     portal = NULL;
> > +     rte_free(portal);
> >  }
> >
> >  static int
> > --
> > 2.23.0
> >
>

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

end of thread, other threads:[~2020-10-05  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 13:07 [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check wangyunjian
2020-10-04 10:41 ` Jerin Jacob
2020-10-04 10:53 ` Nipun Gupta
2020-10-05  9:40   ` Jerin Jacob

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