> -----Original Message----- > From: Basierski, SebastianX > Sent: Tuesday, October 24, 2017 1:11 PM > To: y...@fridaylinux.org > Cc: dev@dpdk.org; Basierski, SebastianX; Tan, Jianfeng; sta...@dpdk.org > Subject: [PATCH v2] Report an error message if the flag O_NONBLOCK > setting fails, then return from function. > > Coverity issue: 143439 > > Fixes: ef53b6030039 ("net/virtio-user: support LSC") > Cc: jianfeng....@intel.com > cc: sta...@dpdk.org > > Signed-off-by: SebastianX Basierski <sebastianx.basier...@intel.com>
Except a nit below, Acked-by: Jianfeng Tan <jianfeng....@intel.com> > --- > drivers/net/virtio/virtio_user_ethdev.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_user_ethdev.c > b/drivers/net/virtio/virtio_user_ethdev.c > index 57c964d..fe3a7be 100644 > --- a/drivers/net/virtio/virtio_user_ethdev.c > +++ b/drivers/net/virtio/virtio_user_ethdev.c > @@ -86,7 +86,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, > size_t offset, > int flags; > > flags = fcntl(dev->vhostfd, F_GETFL); > - fcntl(dev->vhostfd, F_SETFL, flags | O_NONBLOCK); > + if (fcntl(dev->vhostfd, F_SETFL, > + flags | O_NONBLOCK) == -1){ There should be a space between ")" and "{". > + PMD_DRV_LOG(ERR, "error setting > O_NONBLOCK flag"); > + return; > + } > r = recv(dev->vhostfd, buf, 128, MSG_PEEK); > if (r == 0 || (r < 0 && errno != EAGAIN)) { > dev->status &= (~VIRTIO_NET_S_LINK_UP); > -- > 2.7.4