diff options
author | Shalom Toledo <shalomt@mellanox.com> | 2018-10-29 14:26:16 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-04 14:51:55 +0100 |
commit | 6a84bdb84df3ed9c59baaf8a45701aa7f7a36677 (patch) | |
tree | 351f36f22af21159170361c199735fc1bb1dfa21 /drivers/hwmon/g762.c | |
parent | 2d484ce0a878567e8fef8c8484b21531abf77f46 (diff) | |
download | linux-stable-6a84bdb84df3ed9c59baaf8a45701aa7f7a36677.tar.gz linux-stable-6a84bdb84df3ed9c59baaf8a45701aa7f7a36677.tar.bz2 linux-stable-6a84bdb84df3ed9c59baaf8a45701aa7f7a36677.zip |
mlxsw: core: Fix devlink unregister flow
[ Upstream commit a22712a962912faf257e857ab6857f56a93cfb34 ]
After a failed reload, the driver is still registered to devlink, its
devlink instance is still allocated and the 'reload_fail' flag is set.
Then, in the next reload try, the driver's allocated devlink instance will
be freed without unregistering from devlink and its components (e.g,
resources). This scenario can cause a use-after-free if the user tries to
execute command via devlink user-space tool.
Fix by not freeing the devlink instance during reload (failed or not).
Fixes: 24cc68ad6c46 ("mlxsw: core: Add support for reload")
Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon/g762.c')
0 files changed, 0 insertions, 0 deletions