From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5620A1B382 for ; Mon, 13 Nov 2017 14:47:45 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2017 05:47:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,389,1505804400"; d="scan'208";a="2082608" Received: from gklab-246-074.igk.intel.com (HELO Sent) ([10.217.246.74]) by fmsmga001.fm.intel.com with SMTP; 13 Nov 2017 05:47:40 -0800 Received: by Sent (sSMTP sendmail emulation); Mon, 13 Nov 2017 14:38:52 +0100 From: SebastianX Basierski To: dev@dpdk.org Cc: SebastianX Basierski , jianfeng.tan@intel.com, yliu@fridaylinux.org Date: Mon, 13 Nov 2017 14:38:44 +0100 Message-Id: <1510580324-22894-1-git-send-email-sebastianx.basierski@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library 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: , X-List-Received-Date: Mon, 13 Nov 2017 13:47:45 -0000 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 --- 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