public inbox for ofono@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH] atmodem: sim: Fix CRSM result handling
Date: Tue, 28 May 2024 15:07:54 -0500	[thread overview]
Message-ID: <20240528200808.239108-1-denkenz@gmail.com> (raw)

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


             reply	other threads:[~2024-05-28 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 20:07 Denis Kenzior [this message]
2024-05-28 20:50 ` [PATCH] atmodem: sim: Fix CRSM result handling patchwork-bot+ofono

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240528200808.239108-1-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox