mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
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: 6284c723d9
("net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations")
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20220421101247.121896-1-clement.leger@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
5b0b9e4c2c
commit
7f40ea2145
@ -353,6 +353,8 @@ static int br_switchdev_vlan_attr_replay(struct net_device *br_dev,
|
||||
attr.orig_dev = br_dev;
|
||||
|
||||
vg = br_vlan_group(br);
|
||||
if (!vg)
|
||||
return 0;
|
||||
|
||||
list_for_each_entry(v, &vg->vlan_list, vlist) {
|
||||
if (v->msti) {
|
||||
|
Loading…
Reference in New Issue
Block a user