]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: dsa: fix incorrect function pointer check for MRP ring roles
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 5 Jan 2022 13:18:11 +0000 (15:18 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 09:59:45 +0000 (10:59 +0100)
commit39e63d0919de28f227687636aa6942a6b39870f3
treec74172be6f9981b06b7072da60bc6a96155935fc
parent04e8f84afe7191c2d95b26eb267cf070a7bb9ebc
net: dsa: fix incorrect function pointer check for MRP ring roles

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit ff91e1b68490b97c18c649b769618815eb945f11 ]

The cross-chip notifier boilerplate code meant to check the presence of
ds->ops->port_mrp_add_ring_role before calling it, but checked
ds->ops->port_mrp_add instead, before calling
ds->ops->port_mrp_add_ring_role.

Therefore, a driver which implements one operation but not the other
would trigger a NULL pointer dereference.

There isn't any such driver in DSA yet, so there is no reason to
backport the change. Issue found through code inspection.

Cc: Horatiu Vultur <horatiu.vultur@microchip.com>
Fixes: c595c4330da0 ("net: dsa: add MRP support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/dsa/switch.c