From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/3] tools/tester: Fix fd leaks
Date: Wed, 20 Aug 2025 16:15:45 +0200 [thread overview]
Message-ID: <20250820141552.800720-2-hadess@hadess.net> (raw)
In-Reply-To: <20250820141552.800720-1-hadess@hadess.net>
tools/tester.h:314:3: leaked_handle: Handle variable "sk" going out of scope leaks the handle.
tools/l2cap-tester.c:1957:4: leaked_handle: Handle variable "sk" going out of scope leaks the handle.
---
tools/l2cap-tester.c | 1 +
tools/tester.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index c473c6cc6480..208772527c47 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -1954,6 +1954,7 @@ static int connect_socket(const uint8_t *client_bdaddr, GIOFunc connect_cb,
tester_print("Can't enable deferred setup: %s (%d)",
strerror(errno), errno);
tester_test_failed();
+ close(sk);
return -1;
}
}
diff --git a/tools/tester.h b/tools/tester.h
index 8964751102d0..9df600f900ad 100644
--- a/tools/tester.h
+++ b/tools/tester.h
@@ -334,6 +334,7 @@ static inline void test_ethtool_get_ts_info(unsigned int index, int proto,
if (ioctl(sk, SIOCETHTOOL, &ifr) == -1) {
tester_warn("SIOCETHTOOL failed");
tester_test_failed();
+ close(sk);
return;
}
close(sk);
--
2.50.1
next prev parent reply other threads:[~2025-08-20 14:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 14:15 [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning Bastien Nocera
2025-08-20 14:15 ` Bastien Nocera [this message]
2025-08-20 14:15 ` [PATCH BlueZ 3/3] input: Fix incorrect destructors being used Bastien Nocera
2025-08-20 15:52 ` [BlueZ,1/3] profiles/audio: Fix uninitialized params.subgroup_data warning bluez.test.bot
2025-08-21 17:30 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth
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=20250820141552.800720-2-hadess@hadess.net \
--to=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.