Skip to content
Commit 78c8a063 authored by Jiri Pirko's avatar Jiri Pirko Committed by Greg Kroah-Hartman
Browse files

mlxsw: spectrum: Fix use-after-free of split/unsplit/type_set in case reload fails



commit 4340f42f upstream.

In case of reload fail, the mlxsw_sp->ports contains a pointer to a
freed memory (either by reload_down() or reload_up() error path).
Fix this by initializing the pointer to NULL and checking it before
dereferencing in split/unsplit/type_set callpaths.

Fixes: 24cc68ad ("mlxsw: core: Add support for reload")
Reported-by: default avatarDanielle Ratson <danieller@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec3150fc
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