DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library
@ 2017-11-13 13:38 SebastianX Basierski
  2017-11-13 15:59 ` Tan, Jianfeng
  2017-11-14  9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
  0 siblings, 2 replies; 6+ messages in thread
From: SebastianX Basierski @ 2017-11-13 13:38 UTC (permalink / raw)
  To: dev; +Cc: SebastianX Basierski, jianfeng.tan, yliu

Report error message if clearing O_NONBLOCK flag will fail,
then return from function.

Coverity issue: 143439

Fixes: ef53b6030039 ("net/virtio-user: support LSC")
Cc: jianfeng.tan@intel.com
Cc: yliu@fridaylinux.org
cc: dev@dpdk.org

Signed-off-by: SebastianX Basierski <sebastianx.basierski@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 7be57ce..c1f7a64 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -109,7 +109,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
 			} else {
 				dev->status |= VIRTIO_NET_S_LINK_UP;
 			}
-			fcntl(dev->vhostfd, F_SETFL, flags & (~O_NONBLOCK));
+			if (fcntl(dev->vhostfd, F_SETFL,
+					flags & ~O_NONBLOCK) == -1) {
+				PMD_DRV_LOG(ERR, "error clearing O_NONBLOCK flag");
+				return;
+			}
 		}
 		*(uint16_t *)dst = dev->status;
 	}
-- 
2.7.4

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

end of thread, other threads:[~2018-02-06 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 13:38 [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library SebastianX Basierski
2017-11-13 15:59 ` Tan, Jianfeng
2017-11-14  9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
2017-11-14  9:43   ` Maxime Coquelin
2017-11-14 10:39   ` [dpdk-dev] [PATCH v3] " SebastianX Basierski
2018-02-06 20:48     ` Thomas Monjalon

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