linux/drivers/net/wwan
Maciej S. Szmigiero a0c12973ed 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:33:42 +01:00
..
iosm net: wwan: iosm: Properly check for valid exec stage in ipc_mmio_init() 2025-01-09 13:33:42 +01:00
t7xx net: wwan: t7xx: Fix FSM command timeout issue 2025-01-09 13:33:41 +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 net: wwan: mhi: make default data link id configurable 2024-07-03 19:11:01 +05:30
qcom_bam_dmux.c net: wwan: qcom_bam_dmux: Fix missing pm_runtime_disable() 2024-09-27 12:39:02 +01:00
rpmsg_wwan_ctrl.c net: wwan: replace deprecated strncpy with strscpy 2023-10-20 18:15:05 -07:00
wwan_core.c net: wwan: fix global oob in wwan_rtnl_policy 2024-10-21 11:38:44 +02:00
wwan_hwsim.c net: wwan: hwsim: make wwan_hwsim_class constant 2024-03-05 11:21:18 -08:00