Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9176570pxu; Mon, 28 Dec 2020 08:29:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJywdxovisqwKR0rWIkw3k2fz5mTh0vHv3fKShsDtApWntUqxSL7fUz1BiEp3RxkVhOcRcYX X-Received: by 2002:a17:906:c2ca:: with SMTP id ch10mr35523056ejb.157.1609172949066; Mon, 28 Dec 2020 08:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172949; cv=none; d=google.com; s=arc-20160816; b=sQvTYMkyHvQxjM2lSpCSw/pFfBylQ16Rm78DIYEIQOyc41kl5hKLNm4F3nIM9jqhEs DbNu3DVTP+htbVWp7zzp7jnJg0BXRBj7Zml86Jwnlh5j4TsTjx1rfZaNsZkY6zfZ1HwM C72zSzhBLHRrbo9ZQe5+XzfZUXyIGeOJgN19RLdvk7bxFwp9+Culo1gUyxHTMc9XO65P ADfKpCMsrL7BiWGO2OYu7CINJUYnyowKmWXDvWYyCVO60FbKgVS0uFgpsksrfUTZUnyp WhUVgx3+OEu0zR3J3M8mP3dlPk9AE+sMJ7U8uVXnQhhRV4uQdGqAAR0Q3KyG+L5HWcem u1uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GFNL36D9Z1CLGpiWXsbikO3nFtRLp/vbkfApfZCmW0c=; b=VCTyMwAleR8Ouzko5JEMk00LRlAE/ZCxlJa8PNwd7qCDSWwAkq5DGwJhTBe8QOrpAT kHoFERQr2QRYCKpkwEpb8Qir/xDAXg9gl7JLdPxF6razQzN5gkiV56AXI8Tnax9JU1nX 9KeIbmx8HEEl+wIfid/LKePJMRXFzPPWfv0+eALgHzIKKKl6/26xCcfi2KOCEvhr51Vv c0tp2zQNY59HRBXJ5q2vp3Tp/42x/yD5vuouOU6Ml8c9xACUmE+TbJ4zE4MhLptjVP1q k1dFqeQoEggCwCvuUuASyD/EGfrl86W2WGTHLIQTm59jIoYYW8Ujmv3bSfnZDdJczBEK S4yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MEkLDXLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si20177885edq.329.2020.12.28.08.28.46; Mon, 28 Dec 2020 08:29:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MEkLDXLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504473AbgL1Q0o (ORCPT + 99 others); Mon, 28 Dec 2020 11:26:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:36142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730408AbgL1NI3 (ORCPT ); Mon, 28 Dec 2020 08:08:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC1B6207C9; Mon, 28 Dec 2020 13:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160869; bh=6YBKju49kedlPHebqt68JVCos9IWFukPhrbd5V3kEJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MEkLDXLUvdpPCTjAxe4GUhI3Ej9ib4yAxSs1ImGkeNsKVoVov+bNgOq3cNPmD+8Al 8Ac3Agjgy4Pq7tCQQr5uwNnNf9muWXqxW7QNcn/3APGDC1zWtEBjZhR0Kxb4BcMuYw MDpL9EW+WtR7GC8xgIHMQSZSDwn7m0TLAdtuV/to= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Nikolay Aleksandrov , Jakub Kicinski Subject: [PATCH 4.14 023/242] net: bridge: vlan: fix error return code in __vlan_add() Date: Mon, 28 Dec 2020 13:47:08 +0100 Message-Id: <20201228124905.805854869@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Changzhong [ Upstream commit ee4f52a8de2c6f78b01f10b4c330867d88c1653a ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: f8ed289fab84 ("bridge: vlan: use br_vlan_(get|put)_master to deal with refcounts") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/1607071737-33875-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_vlan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -241,8 +241,10 @@ static int __vlan_add(struct net_bridge_ } masterv = br_vlan_get_master(br, v->vid); - if (!masterv) + if (!masterv) { + err = -ENOMEM; goto out_filt; + } v->brvlan = masterv; v->stats = masterv->stats; }