DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Sachin Saxena (OSS)" <sachin.saxena@oss.nxp.com>
To: wangyunjian <wangyunjian@huawei.com>,
	dev@dpdk.org, hemant.agrawal@nxp.com, sachin.saxena@nxp.com
Cc: jerry.lilijun@huawei.com, xudingke@huawei.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] bus/dpaa: fix fd check before close
Date: Wed, 26 Aug 2020 17:38:53 +0530
Message-ID: <93b330ef-5649-0583-5cd2-cd9ab2c9dcae@oss.nxp.com> (raw)
In-Reply-To: <a592a45a42ab9aac815652cc2ec909c1ac1ea9a0.1598420841.git.wangyunjian@huawei.com>

Thanks Yunjian for the fix.

Acked-by: Sachin Saxena<sachin.saxena@oss.nxp.com>


On 26-Aug-20 5:24 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> The fd is possibly a negative value while it is passed as an
> argument to function "close". Fix the check to the fd.
>
> Fixes: b9c94167904f ("bus/dpaa: decouple FQ portal alloc and init")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>   drivers/bus/dpaa/base/qbman/qman_driver.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
> index 1166d68e2..1bff0bc2f 100644
> --- a/drivers/bus/dpaa/base/qbman/qman_driver.c
> +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
> @@ -142,7 +142,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
>   	struct qm_portal_config *q_pcfg;
>   	struct dpaa_ioctl_irq_map irq_map;
>   	struct dpaa_ioctl_portal_map q_map = {0};
> -	int q_fd = 0, ret;
> +	int q_fd = -1, ret;
>   
>   	q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0);
>   	if (!q_pcfg) {
> @@ -191,7 +191,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
>   err:
>   	if (portal)
>   		qman_free_global_portal(portal);
> -	if (q_fd)
> +	if (q_fd != -1)
>   		close(q_fd);
>   	process_portal_unmap(&q_map.addr);
>   	kfree(q_pcfg);


  reply	other threads:[~2020-08-26 12:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 11:54 wangyunjian
2020-08-26 12:08 ` Sachin Saxena (OSS) [this message]
2020-09-14 17:24 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-09-15 12:03   ` wangyunjian
2020-09-15 11:57 ` [dpdk-dev] [PATCH v2] " wangyunjian
2020-09-16 14:48   ` Hemant Agrawal
2020-09-16 23:05   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=93b330ef-5649-0583-5cd2-cd9ab2c9dcae@oss.nxp.com \
    --to=sachin.saxena@oss.nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=sachin.saxena@nxp.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/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 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

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


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