Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2879005pxu; Sat, 19 Dec 2020 05:07:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQbmx+Evyk2C++Jt+UlJ7r8YbQiVzij4Mrz0cxeVW3Whci9y1mtsdq47UfSg7TusrwqBnf X-Received: by 2002:a17:906:7784:: with SMTP id s4mr8328376ejm.93.1608383250578; Sat, 19 Dec 2020 05:07:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383250; cv=none; d=google.com; s=arc-20160816; b=TIZ6CkNQrk+hrClQPj8iXx/44mLZledzWLm2Clnl411FH9SB+PdzOHrHRzCW9JQhtz /Awl9R56Q4oU3Oq3VJZJqCRfIa4GSW5mY7Me5sMRkchCfnCkWGQiaIeipZGDtuMM0Cxc UtYjapDZtOY50zqH9n83SAxtBEpul0Mu2N+xZRk0KBwpRFJuuLRCva6I+WA5VgoVHebu SajC58T9nL5cWH5wvAoy/UBHPYH6cyHSxy0u89Vb2pRgfPy90jt0eFgMaOPXT+yQwPiP xmOKeL8EwHMG3QqOlhDju2qhQrGqAcjeFnp47RBhPOwomo9XP5yM0+feswTsyPIB4HPQ tXFQ== 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=kV0c0vKD5wOppIq3W0QG8wTmPEn4NvWwfqVBlP1i05A=; b=jdCHivkKB7kffwJhYxq+d0UhlX9ITCsR5RpSf193rlwlnEUQzx3tsoAmPHZ1f1AvPA Ov+CyAqe0EB+iWxosaKmceAuT7rBPzKbkU91nlLAGL91NFHVFaTnd0g48DFnCGstHyqN on0ADmyPjtUBK+Eh8s+i2BGTzgu6bbnl71KXnZd4SHkM6w+BlBpdGt6/vAHOi3FyBlMD 8AdSn1Mdet2clesPJg2ZnMN+Rz2CGu5oB6rduGSpZMf/F/Kp+WZy3B3oNloLy5zhMVgv aECStP7WDJC+ppnXcUDhTlcA/rRuhufbuUVPSJcKSxL5LyIsab4KWow4s4l+61dfAVOc xeHg== 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 d3si8694009edj.258.2020.12.19.05.07.07; Sat, 19 Dec 2020 05:07:30 -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 S1728847AbgLSNFg (ORCPT + 99 others); Sat, 19 Dec 2020 08:05:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:52064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728789AbgLSNEO (ORCPT ); Sat, 19 Dec 2020 08:04:14 -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.4 04/34] net: bridge: vlan: fix error return code in __vlan_add() Date: Sat, 19 Dec 2020 14:03:01 +0100 Message-Id: <20201219125341.594620515@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125341.384025953@linuxfoundation.org> References: <20201219125341.384025953@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 @@ -260,8 +260,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);