From: Sean Nyekjaer <sean@geanix.com>
To: denkenz@gmail.com, ofono@lists.linux.dev
Cc: Sean Nyekjaer <sean@geanix.com>
Subject: [PATCH 2/2] sim7100: fix AT chat leak on PPP open failure
Date: Thu, 16 Apr 2026 15:16:48 +0200 [thread overview]
Message-ID: <20260416131649.2151345-2-sean@geanix.com> (raw)
In-Reply-To: <20260416131649.2151345-1-sean@geanix.com>
If opening the PPP channel fails in sim7100_enable(), the previously
opened AT chat instance is not released, resulting in a resource leak.
Fix this by unref'ing the AT chat and clearing the pointer before
returning the error.
---
plugins/sim7100.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/plugins/sim7100.c b/plugins/sim7100.c
index 4148e0b2..169b6b47 100644
--- a/plugins/sim7100.c
+++ b/plugins/sim7100.c
@@ -272,8 +272,11 @@ static int sim7100_enable(struct ofono_modem *modem)
return err;
err = open_device(modem, "PPP", &data->ppp);
- if (err < 0)
+ if (err < 0) {
+ g_at_chat_unref(data->at);
+ data->at = NULL;
return err;
+ }
data->init_count = 0;
data->init_cmd = g_at_chat_send(data->at, "AT", NULL,
--
2.52.0
prev parent reply other threads:[~2026-04-16 13:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 13:16 [PATCH 1/2] sim7100: Add support for A7671 and A7672 models Sean Nyekjaer
2026-04-16 13:16 ` Sean Nyekjaer [this message]
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=20260416131649.2151345-2-sean@geanix.com \
--to=sean@geanix.com \
--cc=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