Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11f27765 authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman
Browse files

staging: fsl-dpaa2: ethsw: Add missing netdevice check



port_switchdev_event() does not check that the target network device is
actually backed by the ethsw driver, this could be problematic in a
stacked environment case.

Fixes: 44baaa43 ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2c62d36c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1047,6 +1047,9 @@ static int port_switchdev_event(struct notifier_block *unused,
	struct ethsw_switchdev_event_work *switchdev_work;
	struct switchdev_notifier_fdb_info *fdb_info = ptr;

	if (!ethsw_port_dev_check(dev))
		return NOTIFY_DONE;

	switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
	if (!switchdev_work)
		return NOTIFY_BAD;