Commit 7f40ea21 authored by Clément Léger's avatar Clément Léger Committed by Jakub Kicinski

net: bridge: switchdev: check br_vlan_group() return value

br_vlan_group() can return NULL and thus return value must be checked
to avoid dereferencing a NULL pointer.

Fixes: 6284c723 ("net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations")
Signed-off-by: default avatarClément Léger <clement.leger@bootlin.com>
Acked-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20220421101247.121896-1-clement.leger@bootlin.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5b0b9e4c
...@@ -353,6 +353,8 @@ static int br_switchdev_vlan_attr_replay(struct net_device *br_dev, ...@@ -353,6 +353,8 @@ static int br_switchdev_vlan_attr_replay(struct net_device *br_dev,
attr.orig_dev = br_dev; attr.orig_dev = br_dev;
vg = br_vlan_group(br); vg = br_vlan_group(br);
if (!vg)
return 0;
list_for_each_entry(v, &vg->vlan_list, vlist) { list_for_each_entry(v, &vg->vlan_list, vlist) {
if (v->msti) { if (v->msti) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment