public inbox for ofono@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] atmodem: sim: Fix CRSM result handling
@ 2024-05-28 20:07 Denis Kenzior
  2024-05-28 20:50 ` patchwork-bot+ofono
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Kenzior @ 2024-05-28 20:07 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

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(+)

diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index cbf87fb4c095..5aa89da38905 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -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)
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] atmodem: sim: Fix CRSM result handling
  2024-05-28 20:07 [PATCH] atmodem: sim: Fix CRSM result handling Denis Kenzior
@ 2024-05-28 20:50 ` patchwork-bot+ofono
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+ofono @ 2024-05-28 20:50 UTC (permalink / raw)
  To: Denis Kenzior; +Cc: ofono

Hello:

This patch was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-28 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 20:07 [PATCH] atmodem: sim: Fix CRSM result handling Denis Kenzior
2024-05-28 20:50 ` patchwork-bot+ofono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox