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

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
...@@ -1047,6 +1047,9 @@ static int port_switchdev_event(struct notifier_block *unused, ...@@ -1047,6 +1047,9 @@ static int port_switchdev_event(struct notifier_block *unused,
struct ethsw_switchdev_event_work *switchdev_work; struct ethsw_switchdev_event_work *switchdev_work;
struct switchdev_notifier_fdb_info *fdb_info = ptr; 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); switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
if (!switchdev_work) if (!switchdev_work)
return NOTIFY_BAD; return NOTIFY_BAD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment