diff options
author | Clément Léger <clement.leger@bootlin.com> | 2022-04-21 12:12:47 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-04-23 00:12:18 +0200 |
commit | 7f40ea2145d926510b27b785562d2c92df1b0d91 (patch) | |
tree | 1203e8603abefdd9a13e4f815c0312939fb1400d /net/bridge | |
parent | tcp: md5: incorrect tcp_header_len for incoming connections (diff) | |
download | linux-7f40ea2145d926510b27b785562d2c92df1b0d91.tar.xz linux-7f40ea2145d926510b27b785562d2c92df1b0d91.zip |
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: 6284c723d9b9 ("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>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_switchdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c index 8cc44c367231..18affda2b522 100644 --- a/net/bridge/br_switchdev.c +++ b/net/bridge/br_switchdev.c @@ -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) { |