patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value
@ 2020-09-25 11:22 wangyunjian
  2020-09-30  5:28 ` Xia, Chenbo
  2020-09-30 16:18 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: wangyunjian @ 2020-09-25 11:22 UTC (permalink / raw)
  To: dev
  Cc: maxime.coquelin, chenbo.xia, zhihong.wang, jerry.lilijun,
	xudingke, Yunjian Wang, stable

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


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value
  2020-09-25 11:22 [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value wangyunjian
@ 2020-09-30  5:28 ` Xia, Chenbo
  2020-09-30 16:18 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Xia, Chenbo @ 2020-09-30  5:28 UTC (permalink / raw)
  To: wangyunjian, dev
  Cc: maxime.coquelin, Wang, Zhihong, jerry.lilijun, xudingke, stable

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

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value
  2020-09-25 11:22 [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value wangyunjian
  2020-09-30  5:28 ` Xia, Chenbo
@ 2020-09-30 16:18 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2020-09-30 16:18 UTC (permalink / raw)
  To: wangyunjian, dev
  Cc: chenbo.xia, zhihong.wang, jerry.lilijun, xudingke, stable



On 9/25/20 1:22 PM, wangyunjian wrote:
> 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(-)


Applied to dpdk-next-virtio/main.

Thanks,
Maxime


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

end of thread, other threads:[~2020-09-30 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 11:22 [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value wangyunjian
2020-09-30  5:28 ` Xia, Chenbo
2020-09-30 16:18 ` Maxime Coquelin

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