mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
mlxsw: spectrum: Avoid possible NULL pointer dereference
[ Upstream commitc0e01eac7a] 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:12f1501e75("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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
eed386e2e2
commit
c8799579ff
@@ -1448,8 +1448,7 @@ do_fdb_op:
|
||||
err = mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid,
|
||||
adding, true);
|
||||
if (err) {
|
||||
if (net_ratelimit())
|
||||
netdev_err(mlxsw_sp_port->dev, "Failed to set FDB entry\n");
|
||||
dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to set FDB entry\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1509,8 +1508,7 @@ do_fdb_op:
|
||||
err = mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp, lag_id, mac, fid, lag_vid,
|
||||
adding, true);
|
||||
if (err) {
|
||||
if (net_ratelimit())
|
||||
netdev_err(mlxsw_sp_port->dev, "Failed to set FDB entry\n");
|
||||
dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to set FDB entry\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user