From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2C848A04B3; Mon, 16 Dec 2019 06:51:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 743C41C0CF; Mon, 16 Dec 2019 06:51:34 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 2CEA01C0CC; Mon, 16 Dec 2019 06:51:32 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Dec 2019 21:51:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,320,1571727600"; d="scan'208";a="205002315" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by orsmga007.jf.intel.com with ESMTP; 15 Dec 2019 21:51:29 -0800 Date: Mon, 16 Dec 2019 13:51:48 +0800 From: Tiwei Bie To: Yunjian Wang Cc: dev@dpdk.org, maxime.coquelin@redhat.com, zhihong.wang@intel.com, xudingke@huawei.com, stable@dpdk.org Message-ID: <20191216055148.GB133010@___> References: <1576458195-27980-1-git-send-email-wangyunjian@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1576458195-27980-1-git-send-email-wangyunjian@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: fix return value of tap offload sets not checked 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Dec 16, 2019 at 09:03:15AM +0800, Yunjian Wang wrote: > The function vhost_kernel_tap_set_offload() could return errors, > the return value need to be checked. > > Fixes: 1db4d2330bc8 ("net/virtio-user: check negotiated features before set") > Cc: stable@dpdk.org > > Signed-off-by: Yunjian Wang > --- > drivers/net/virtio/virtio_user/vhost_kernel_tap.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c > index 76bf754..f77d227 100644 > --- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c > +++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c > @@ -131,7 +131,8 @@ > goto error; > } > > - vhost_kernel_tap_set_offload(tapfd, features); > + if (vhost_kernel_tap_set_offload(tapfd, features) < 0) > + goto error; It's not necessary to fail in this case. At least, there is no need to fail when error is -ENOTSUP. > > memset(&ifr, 0, sizeof(ifr)); > ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; > -- > 1.8.3.1 > >