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

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