All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: bridge: switchdev: check br_vlan_group() return value
@ 2022-04-21 10:12 ` Clément Léger
  0 siblings, 0 replies; 8+ messages in thread
From: Clément Léger @ 2022-04-21 10:12 UTC (permalink / raw)
  To: Roopa Prabhu, Nikolay Aleksandrov, David S. Miller,
	Jakub Kicinski, Paolo Abeni, Tobias Waldekranz
  Cc: bridge, netdev, linux-kernel, Clément Léger

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>
---
 net/bridge/br_switchdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
index 81400e0b26ac..8f3d76c751dd 100644
--- a/net/bridge/br_switchdev.c
+++ b/net/bridge/br_switchdev.c
@@ -354,6 +354,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) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-04-22 22:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 10:12 [PATCH net-next] net: bridge: switchdev: check br_vlan_group() return value Clément Léger
2022-04-21 10:12 ` [Bridge] " Clément Léger
2022-04-21 10:17 ` Nikolay Aleksandrov
2022-04-21 10:17   ` [Bridge] " Nikolay Aleksandrov
2022-04-22 22:14   ` Jakub Kicinski
2022-04-22 22:14     ` [Bridge] " Jakub Kicinski
2022-04-22 22:20 ` patchwork-bot+netdevbpf
2022-04-22 22:20   ` [Bridge] " patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.