Skip to contentSkip to conversation

atmodem: sim: Fix CRSM result handling

PATCH Applied Denis Kenzior 2 participants 2 messages May 28, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atmodem: sim: Fix CRSM result handling

The previous commit tries to parse all CRSM lines until sw1 and sw2 parameters are found. Unfortunately the current logic does not break out of the loop once a valid result line is detected, and the iterator is modified once again, becoming invalid. This results in subsequent operations (g_at_result_iter_next_hexstring) failing. Fix that by breaking out of the loop as soon as sw1 and sw2 parameters are read successfully.

Fixes 7802d80a9619 ("atmodem: sim: when reading sim files, avoid incomplete result lines")
---
 drivers/atmodem/sim.c | 1 +
 1 file changed, 1 insertion(+)
drivers/atmodem/sim.c +1 -0
index cbf87fb4c095..5aa89da38905 100644
@@ -126,6 +126,7 @@ static void get_response_common_cb(gboolean ok, GAtResult *result,
 		if (!g_at_result_iter_next_number(&iter, &sw2))
 			continue;
 		result_found = TRUE;
+		break;
 	}
 
 	if (!result_found)
Signature · 1 line
2.45.0
#1 lore raw
This patch was applied to ofono.git (master) by Denis Kenzior <[email protected]>:

Hello:

This patch was applied to ofono.git (master)
by Denis Kenzior <[email protected]>:

Quoted 9 lines · On Tue, 28 May 2024 15:07:54 -0500 you wrote:

The previous commit tries to parse all CRSM lines until sw1 and sw2 parameters are found. Unfortunately the current logic does not break out of the loop once a valid result line is detected, and the iterator is modified once again, becoming invalid. This results in subsequent operations (g_at_result_iter_next_hexstring) failing. Fix that by breaking out of the loop as soon as sw1 and sw2 parameters are read successfully.

[...]

Here is the summary with links:
- atmodem: sim: Fix CRSM result handling

    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=31dfe78a070f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html