From: Steve Schrock <steve.schrock@getcruise.com>
To: ofono@lists.linux.dev
Cc: Steve Schrock <steve.schrock@getcruise.com>
Subject: [PATCH] qmimodem: Fix error path memory leak in gobi
Date: Tue, 7 May 2024 10:33:58 -0500 [thread overview]
Message-ID: <20240507153408.681340-1-steve.schrock@getcruise.com> (raw)
I noticed this leak when I terminated ofonod while gobi was retrying
discovery on an unresponsive QMUX device.
==8257== 20 (16 direct, 4 indirect) bytes in 1 blocks are definitely lost in loss record 31 of 154
==8257== at 0x4885118: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==8257== by 0x5A4737: l_malloc (util.c:49)
==8257== by 0x4669E3: qmi_param_new (qmi.c:2374)
==8257== by 0x466D73: qmi_param_new_uint8 (qmi.c:2449)
==8257== by 0x47D717: gobi_disable (gobi.c:482)
==8257== by 0x51BAD7: set_powered (modem.c:986)
==8257== by 0x51E8FB: __ofono_modem_shutdown (modem.c:2279)
==8257== by 0x518233: signal_handler (main.c:85)
==8257== by 0x496D14F: ??? (in /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0.7800.0)
==8257== by 0x49CDE47: ??? (in /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0.7800.0)
==8257== by 0x496DBFF: g_main_loop_run (in /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0.7800.0)
==8257== by 0x518A23: main (main.c:314)
---
plugins/gobi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/gobi.c b/plugins/gobi.c
index 39c1ab81fa56..8bd2c4060446 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -488,6 +488,7 @@ static int gobi_disable(struct ofono_modem *modem)
power_disable_cb, modem, NULL) > 0)
return -EINPROGRESS;
+ qmi_param_free(param);
out:
shutdown_device(modem);
--
2.43.2
--
*Confidentiality Note:* We care about protecting our proprietary
information, confidential material, and trade secrets. This message may
contain some or all of those things. Cruise will suffer material harm if
anyone other than the intended recipient disseminates or takes any action
based on this message. If you have received this message (including any
attachments) in error, please delete it immediately and notify the sender
promptly.
next reply other threads:[~2024-05-07 15:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 15:33 Steve Schrock [this message]
2024-05-07 16:30 ` [PATCH] qmimodem: Fix error path memory leak in gobi 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=20240507153408.681340-1-steve.schrock@getcruise.com \
--to=steve.schrock@getcruise.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).