> -----Original Message----- > From: wangyunjian <[email protected]> > Sent: Friday, September 25, 2020 7:22 PM > To: [email protected] > Cc: [email protected]; Xia, Chenbo <[email protected]>; Wang, > Zhihong <[email protected]>; [email protected]; > [email protected]; Yunjian Wang <[email protected]>; > [email protected] > Subject: [dpdk-dev] [PATCH] examples/vhost_blk: fix unchecked return value > > From: Yunjian Wang <[email protected]> > > 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: [email protected] > > Signed-off-by: Yunjian Wang <[email protected]> > --- > 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 <[email protected]>

