patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@nxp.com>
To: wangyunjian <wangyunjian@huawei.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: "jerry.lilijun@huawei.com" <jerry.lilijun@huawei.com>,
	"xudingke@huawei.com" <xudingke@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] event/dpaa2: fix dereference before null check
Date: Sun, 4 Oct 2020 10:53:32 +0000
Message-ID: <AM5PR0401MB2593DB7859833AD32AECA464E60F0@AM5PR0401MB2593.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <befbb8824171ccb7493fc968ee732263fbc32f52.1598423164.git.wangyunjian@huawei.com>

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
> 


  parent reply	other threads:[~2020-10-04 10:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 13:07 wangyunjian
2020-10-04 10:41 ` Jerin Jacob
2020-10-04 10:53 ` Nipun Gupta [this message]
2020-10-05  9:40   ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM5PR0401MB2593DB7859833AD32AECA464E60F0@AM5PR0401MB2593.eurprd04.prod.outlook.com \
    --to=nipun.gupta@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    --cc=xudingke@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git