DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Hu, Jiayu" <jiayu.hu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: RE: [PATCH] vhost: fix unchecked return value
Date: Thu, 23 Jun 2022 02:44:58 +0000	[thread overview]
Message-ID: <SN6PR11MB3504B7AFE11C0C9824B230329CB59@SN6PR11MB3504.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220623010858.951367-1-jiayu.hu@intel.com>

Hi Jiayu,

> -----Original Message-----
> From: Hu, Jiayu <jiayu.hu@intel.com>
> Sent: Thursday, June 23, 2022 9:09 AM
> To: dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
> Jiayu <jiayu.hu@intel.com>
> Subject: [PATCH] vhost: fix unchecked return value
> 
> This patch checks the return value of rte_dma_info_get()
> called in rte_vhost_async_dma_configure().
> 
> Coverity issue: 379066
> Fixes: 53d3f4778c1d ("vhost: integrate dmadev in asynchronous data-path")

Missed CC stable tag

With this fixed:

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

> 
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> ---
>  lib/vhost/vhost.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
> index b14521e4d1..70c04c036e 100644
> --- a/lib/vhost/vhost.c
> +++ b/lib/vhost/vhost.c
> @@ -1868,7 +1868,11 @@ rte_vhost_async_dma_configure(int16_t dma_id,
> uint16_t vchan_id)
>  		return -1;
>  	}
> 
> -	rte_dma_info_get(dma_id, &info);
> +	if (rte_dma_info_get(dma_id, &info) != 0) {
> +		VHOST_LOG_CONFIG(ERR, "Fail to get DMA %d information.\n",
> dma_id);
> +		return -1;
> +	}
> +
>  	if (vchan_id >= info.max_vchans) {
>  		VHOST_LOG_CONFIG(ERR, "Invalid DMA %d vChannel %u.\n", dma_id,
> vchan_id);
>  		return -1;
> --
> 2.25.1


  reply	other threads:[~2022-06-23  2:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  1:08 Jiayu Hu
2022-06-23  2:44 ` Xia, Chenbo [this message]
2022-06-29  9:07 ` [PATCH v2] " Jiayu Hu
2022-06-30  9:56   ` Maxime Coquelin
2022-07-01  7:11     ` Hu, Jiayu
2022-07-01  7:52       ` Maxime Coquelin
2022-07-01 13:59   ` Maxime Coquelin
2022-07-01 14:11     ` Hu, Jiayu

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=SN6PR11MB3504B7AFE11C0C9824B230329CB59@SN6PR11MB3504.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=jiayu.hu@intel.com \
    --cc=maxime.coquelin@redhat.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).