[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201228124921.578652821@linuxfoundation.org>
Date: Mon, 28 Dec 2020 13:45:56 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Hulk Robot <hulkci@...wei.com>,
Zhang Changzhong <zhangchangzhong@...wei.com>,
Nikolay Aleksandrov <nikolay@...dia.com>,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH 4.19 037/346] net: bridge: vlan: fix error return code in __vlan_add()
From: Zhang Changzhong <zhangchangzhong@...wei.com>
[ 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 <hulkci@...wei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.com>
Acked-by: Nikolay Aleksandrov <nikolay@...dia.com>
Link: https://lore.kernel.org/r/1607071737-33875-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
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
@@ -242,8 +242,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;
} else {
Powered by blists - more mailing lists