mlxsw: core: Fix use-after-free calling devl_unlock() in mlxsw_core_bus_device_unregi...
authorJiri Pirko <jiri@nvidia.com>
Thu, 21 Jul 2022 14:24:24 +0000 (16:24 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 22 Jul 2022 21:41:24 +0000 (14:41 -0700)
commit1b5995e370e4024e7bb7408247363e8e67f0393d
treec35efec4eb686bafb520a5080f850ca274692c27
parent949d6b405e6160ae44baea39192d67b39cb7eeac
mlxsw: core: Fix use-after-free calling devl_unlock() in mlxsw_core_bus_device_unregister()

Do devl_unlock() before freeing the devlink in
mlxsw_core_bus_device_unregister() function.

Reported-by: Ido Schimmel <idosch@nvidia.com>
Fixes: 72a4c8c94efa ("mlxsw: convert driver to use unlocked devlink API during init/fini")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20220721142424.3975704-1-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core.c