From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 80C37A04C0; Fri, 25 Sep 2020 13:26:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF64F1E933; Fri, 25 Sep 2020 13:26:22 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 07B7F1D561; Fri, 25 Sep 2020 13:26:21 +0200 (CEST) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 329A5C9BD595F3A3830B; Fri, 25 Sep 2020 19:26:19 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Fri, 25 Sep 2020 19:26:11 +0800 From: wangyunjian To: CC: , , , , , Yunjian Wang , Date: Fri, 25 Sep 2020 19:22:06 +0800 Message-ID: <87d9cf9f99c249962a9445167271878896e85d2f.1601032637.git.wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Yunjian Wang 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 --- 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