summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl-dpaa2
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2019-02-22 14:02:14 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-26 11:52:46 +0100
commit11f27765f61175ac9602a05e305b9034dc6c80bf (patch)
treeb0a16f276a7e50e0140d0eeefb70694020b7f398 /drivers/staging/fsl-dpaa2
parent2c62d36c8144b2bf5971edcbb803a3b2c7d59239 (diff)
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: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-dpaa2')
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index daabaceeea52..2edd82f5229a 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -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;