Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2874633pxu; Sat, 19 Dec 2020 05:01:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEA3nwZXyjJR08tL2awcrC7Wx0qhUD7cfMcTc/XBOo433D7REbjqHrGVtIWZvx1iF7Yt0S X-Received: by 2002:a50:b765:: with SMTP id g92mr8720278ede.317.1608382896639; Sat, 19 Dec 2020 05:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608382896; cv=none; d=google.com; s=arc-20160816; b=aJATAXCNdq1I2kTB00w2SRvpgC5XXabvCuAJmktajLYpJuOVjBTxRAm+97BvM1KDUh ei5wdpuBRm/j0wrJqjjeE2sMPYz3EG+WNNlakeFNVop+9w5uL/JWXbX/huy4B6WzZkNI /aZjYQYm1UpvOp05m23U55EjZF02R3pjGheh53CMxXLWk/NQlSy49AkcNS2P6+qjy1b2 gsWZkKoPVrYOr+Y5CoZTJGz0Pj6vK6S4lAgY3Sn1in6ISSUXu2sAdWNuwWf+IY4Umupn 5QOBCtTeE1GLr6bupgVwXFpHUceoDbx6HGYTGQJ2pRdv4K8Zgyujp7IEdxLrjoUWLuyf EP9Q== 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; bh=RGbOmhrpAVCubeNX3Kba7+nx55h/LkTB1E5LY72Xwks=; b=ntCi3Qejpl/Oizt4v3JT8KIkp7UZS80Y7cR/kVprcdLZuPp9R6luPqE7Vp2IkZ85PL jQD305y+fEJMWhkJXhpQpO7QF3erEP8Afu1H8uE20+ENvmZpvTQHhOuyrv1aAfJaAeGG fniCSOSTH1FtOOKpYm7Us9O/84Y+1/7vCJSyr+xaUmRmVjysv20sO25ZpzCCuasSR7BJ YnuDmUv/vXNBFfJz7Tl8t7oeofZsBNRfjB9nqWhTTWlVNdQw8z0rAuHftgev+laopIun uz55IHpnMVS2Tgmn482LcUnBjCE8MhiHJ61WizA76dUsbGlFkfC0y/YP1XZ/ptRD3Pgc NDgw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 y12si7987762edp.127.2020.12.19.05.01.14; Sat, 19 Dec 2020 05:01:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728196AbgLSM7a (ORCPT + 99 others); Sat, 19 Dec 2020 07:59:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:45958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbgLSM7F (ORCPT ); Sat, 19 Dec 2020 07:59:05 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Nikolay Aleksandrov , Jakub Kicinski Subject: [PATCH 5.9 06/49] net: bridge: vlan: fix error return code in __vlan_add() Date: Sat, 19 Dec 2020 13:58:10 +0100 Message-Id: <20201219125344.991175997@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@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 @@ -266,8 +266,10 @@ static int __vlan_add(struct net_bridge_ } masterv = br_vlan_get_master(br, v->vid, extack); - if (!masterv) + if (!masterv) { + err = -ENOMEM; goto out_filt; + } v->brvlan = masterv; if (br_opt_get(br, BROPT_VLAN_STATS_PER_PORT)) { v->stats = netdev_alloc_pcpu_stats(struct br_vlan_stats);