]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Avoid possible NULL pointer dereference
authorIdo Schimmel <idosch@mellanox.com>
Thu, 18 May 2017 11:03:52 +0000 (13:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 May 2017 15:27:21 +0000 (11:27 -0400)
commit5263a245e8f4db60ed63ea2c03d755ed75742f82
treef184c432b4633aa2792f078de146810c2c6c972b
parent4963b7b3249e9c5cbede4dab7e5f377923fc17cf
mlxsw: spectrum: Avoid possible NULL pointer dereference

In case we got an FDB notification for a port that doesn't exist we
execute an FDB entry delete to prevent it from re-appearing the next
time we poll for notifications.

If the operation failed we would trigger a NULL pointer dereference as
'mlxsw_sp_port' is NULL.

Fix it by reporting the error using the underlying bus device instead.

Fixes: b2bbdc6ced1f ("mlxsw: spectrum: remove FDB entry in case we get unknown object notification")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c