aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorVadim Pasternak <[email protected]>2023-10-05 07:56:14 +0000
committerIlpo Järvinen <[email protected]>2023-10-06 16:40:35 +0300
commit7ec4cd3c1a12dc08c60d5e376c2c05aae23f1e41 (patch)
tree8f178b70a7972c425828431221cff5e7ee750ada /lib/test_fortify/write_overflow-strncpy-src.c
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d (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 <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/T/ Signed-off-by: Vadim Pasternak <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions