linux/drivers/net/wwan
Maciej S. Szmigiero 23f2e7a13f net: wwan: iosm: Properly check for valid exec stage in ipc_mmio_init()
[ Upstream commit a7af435df0 ]

ipc_mmio_init() used the post-decrement operator in its loop continuing
condition of "retries" counter being "> 0", which meant that when this
condition caused loop exit "retries" counter reached -1.

But the later valid exec stage failure check only tests for "retries"
counter being exactly zero, so it didn't trigger in this case (but
would wrongly trigger if the code reaches a valid exec stage in the
very last loop iteration).

Fix this by using the pre-decrement operator instead, so the loop counter
is exactly zero on valid exec stage failure.

Fixes: dc0514f5d8 ("net: iosm: mmio scratchpad")
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Link: https://patch.msgid.link/8b19125a825f9dcdd81c667c1e5c48ba28d505a6.1735490770.git.mail@maciej.szmigiero.name
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-01-09 13:32:02 +01:00
..
iosm net: wwan: iosm: Properly check for valid exec stage in ipc_mmio_init() 2025-01-09 13:32:02 +01:00
t7xx net: wwan: t7xx: Fix FSM command timeout issue 2025-01-09 13:32:01 +01:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-10 17:43:53 -08:00
Makefile net: wwan: t7xx: Add core components 2022-05-09 10:51:59 +01:00
mhi_wwan_ctrl.c wwan: core: Support slicing in port TX flow of WWAN subsystem 2023-03-17 22:38:31 -07:00
mhi_wwan_mbim.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-10 17:43:53 -08:00
qcom_bam_dmux.c net: wwan: qcom_bam_dmux: Fix missing pm_runtime_disable() 2024-10-10 11:57:15 +02:00
rpmsg_wwan_ctrl.c net: wwan: Expose secondary AT port on DATA1 2023-04-19 12:54:26 +01:00
wwan_core.c net: wwan: fix global oob in wwan_rtnl_policy 2024-11-01 01:58:29 +01:00
wwan_hwsim.c Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00