DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: wangyunjian <wangyunjian@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"Wang, Zhihong" <zhihong.wang@intel.com>,
	"jerry.lilijun@huawei.com" <jerry.lilijun@huawei.com>,
	"xudingke@huawei.com" <xudingke@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value
Date: Wed, 30 Sep 2020 05:28:16 +0000	[thread overview]
Message-ID: <MN2PR11MB40635F53D1C2A560108F7AC19C330@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87d9cf9f99c249962a9445167271878896e85d2f.1601032637.git.wangyunjian@huawei.com>

> -----Original Message-----
> From: wangyunjian <wangyunjian@huawei.com>
> Sent: Friday, September 25, 2020 7:22 PM
> To: dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Wang,
> Zhihong <zhihong.wang@intel.com>; jerry.lilijun@huawei.com;
> xudingke@huawei.com; Yunjian Wang <wangyunjian@huawei.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value
> 
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> This checks the return value from the function
> rte_vhost_driver_start.
> 
> Coverity issue: 362027
> Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  examples/vhost_blk/vhost_blk.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/vhost_blk/vhost_blk.c
> b/examples/vhost_blk/vhost_blk.c
> index f4c59437a..8f5d61a58 100644
> --- a/examples/vhost_blk/vhost_blk.c
> +++ b/examples/vhost_blk/vhost_blk.c
> @@ -877,7 +877,11 @@ int main(int argc, char *argv[])
> 
>  	signal(SIGINT, signal_handler);
> 
> -	rte_vhost_driver_start(dev_pathname);
> +	ret = rte_vhost_driver_start(dev_pathname);
> +	if (ret < 0) {
> +		fprintf(stderr, "Failed to start vhost driver.\n");
> +		return -1;
> +	}
> 
>  	/* loop for exit the application */
>  	while (1)
> --
> 2.23.0

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

  reply	other threads:[~2020-09-30  5:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 11:22 wangyunjian
2020-09-30  5:28 ` Xia, Chenbo [this message]
2020-09-30 16:18 ` Maxime Coquelin

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=MN2PR11MB40635F53D1C2A560108F7AC19C330@MN2PR11MB4063.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerry.lilijun@huawei.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    --cc=xudingke@huawei.com \
    --cc=zhihong.wang@intel.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).