From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 826FE1B1F3 for ; Tue, 14 Nov 2017 10:43:57 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9702C058EDD; Tue, 14 Nov 2017 09:43:56 +0000 (UTC) Received: from [10.36.112.48] (ovpn-112-48.ams2.redhat.com [10.36.112.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B372895B2; Tue, 14 Nov 2017 09:43:55 +0000 (UTC) To: SebastianX Basierski , dev@dpdk.org Cc: jianfeng.tan@intel.com, yliu@fridaylinux.org References: <1510580324-22894-1-git-send-email-sebastianx.basierski@intel.com> <1510651655-36160-1-git-send-email-sebastianx.basierski@intel.com> From: Maxime Coquelin Message-ID: Date: Tue, 14 Nov 2017 10:43:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1510651655-36160-1-git-send-email-sebastianx.basierski@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 14 Nov 2017 09:43:56 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v2] net/virtio-user: 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: , X-List-Received-Date: Tue, 14 Nov 2017 09:43:57 -0000 Hi Sebastian, On 11/14/2017 10:27 AM, SebastianX Basierski wrote: > Report error message if clearing O_NONBLOCK flag will fail, > then return from function. > > --- > v2: > Patch title changed. > --- ^^^^The above note should be placed just before diffstats to be removed at apply time. > 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 > Acked-by: Jianfeng Tan > --- Here > 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; > } > Other than that: Acked-by: Maxime Coquelin Thanks, Maxime