diff options
author | Vadim Pasternak <vadimp@nvidia.com> | 2023-10-05 07:56:14 +0000 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-10-06 16:40:35 +0300 |
commit | 7ec4cd3c1a12dc08c60d5e376c2c05aae23f1e41 (patch) | |
tree | 8f178b70a7972c425828431221cff5e7ee750ada /scripts/gdb/linux/mm.py | |
parent | 0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff) |
platform: mellanox: Fix a resource leak in an error handling path in probing flow
Fix missed resource deallocation in rollback flows.
Currently if an error occurs after a successful
mlxplat_i2c_main_init(), mlxplat_i2c_main_exit() call is missed in
rollback flow.
Thus, some resources are not de-allocated.
Move mlxplat_pre_exit() call from mlxplat_remove() into
mlxplat_i2c_main_exit().
Call mlxplat_i2c_main_exit() instead of calling mlxplat_pre_exit() in
mlxplat_probe() error handling flow.
Unregister 'priv->pdev_i2c' device in mlxplat_i2c_main_init() cleanup
flow if this device was successfully registered.
Fixes: 158cd8320776 ("platform: mellanox: Split logic in init and exit flow")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/lkml/70165032-796e-6f5c-6748-f514e3b9d08c@linux.intel.com/T/
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231005075616.42777-2-vadimp@nvidia.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'scripts/gdb/linux/mm.py')
0 files changed, 0 insertions, 0 deletions