From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id CD229A04B3
	for <public@inbox.dpdk.org>; Mon, 16 Dec 2019 06:51:36 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 7A3561C0DC;
	Mon, 16 Dec 2019 06:51:36 +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 <tiwei.bie@intel.com>
To: Yunjian Wang <wangyunjian@huawei.com>
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-stable] [PATCH] net/virtio-user: fix return value of tap
 offload sets not checked
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

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 <wangyunjian@huawei.com>
> ---
>  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
> 
>