]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: wwan: iosm: Fix tainted pointer delete is case of region creation fail
authorAleksandr Mishin <amishin@t-argos.ru>
Tue, 4 Jun 2024 08:25:00 +0000 (11:25 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 6 Jun 2024 08:15:14 +0000 (10:15 +0200)
commitb0c9a26435413b81799047a7be53255640432547
treeafd0780f02f39bf810212176bd2ff12de07ade06
parent5899c885131a7b2926ed26f6a5df1fc3c878418d
net: wwan: iosm: Fix tainted pointer delete is case of region creation fail

In case of region creation fail in ipc_devlink_create_region(), previously
created regions delete process starts from tainted pointer which actually
holds error code value.
Fix this bug by decreasing region index before delete.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 4dcd183fbd67 ("net: wwan: iosm: devlink registration")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Acked-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240604082500.20769-1-amishin@t-argos.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/wwan/iosm/iosm_ipc_devlink.c