linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning
@ 2025-08-20 14:15 Bastien Nocera
  2025-08-20 14:15 ` [PATCH BlueZ 2/3] tools/tester: Fix fd leaks Bastien Nocera
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bastien Nocera @ 2025-08-20 14:15 UTC (permalink / raw)
  To: linux-bluetooth

profiles/audio/bass.c:923:2: uninit_use_in_call: Using uninitialized value "params". Field "params.subgroup_data" is uninitialized when calling "util_iov_append".
---
 profiles/audio/bass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index 055d51b8927e..efa58e62b62f 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -918,7 +918,7 @@ static DBusMessage *push(DBusConnection *conn, DBusMessage *msg,
 {
 	struct bass_assistant *assistant = user_data;
 	struct bt_bass_bcast_audio_scan_cp_hdr hdr;
-	struct bt_bass_add_src_params params;
+	struct bt_bass_add_src_params params = {0};
 	struct iovec iov = {0};
 	uint32_t bis_sync = 0;
 	uint8_t meta_len = 0;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH BlueZ 2/3] tools/tester: Fix fd leaks
  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
  2025-08-20 14:15 ` [PATCH BlueZ 3/3] input: Fix incorrect destructors being used Bastien Nocera
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2025-08-20 14:15 UTC (permalink / raw)
  To: linux-bluetooth

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH BlueZ 3/3] input: Fix incorrect destructors being used
  2025-08-20 14:15 [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning Bastien Nocera
  2025-08-20 14:15 ` [PATCH BlueZ 2/3] tools/tester: Fix fd leaks Bastien Nocera
@ 2025-08-20 14:15 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2025-08-20 14:15 UTC (permalink / raw)
  To: linux-bluetooth

g_key_file_get_string() expects its value to be freed with g_free(), not
free().

Fixes:
profiles/input/manager.c:118:2: leaked_storage: Variable "uhid_enabled" going out of scope leaks the storage it points to.
profiles/input/hog.c:267:1: leaked_storage: Variable "uhid_enabled" going out of scope leaks the storage it points to.
---
 profiles/input/hog.c     | 2 +-
 profiles/input/manager.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index f5d24aad67e2..1f5b82b77435 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -259,7 +259,7 @@ static void hog_read_config(void)
 	if (!err) {
 		DBG("input.conf: UserspaceHID=%s", uhid_enabled);
 		uhid_state_persist = strcasecmp(uhid_enabled, "persist") == 0;
-		free(uhid_enabled);
+		g_free(uhid_enabled);
 	} else
 		g_clear_error(&err);
 
diff --git a/profiles/input/manager.c b/profiles/input/manager.c
index d0db13f2d3e9..b0e415f6706c 100644
--- a/profiles/input/manager.c
+++ b/profiles/input/manager.c
@@ -101,7 +101,7 @@ static int input_init(void)
 		if (!err) {
 			DBG("input.conf: UserspaceHID=%s", uhid_enabled);
 			input_set_userspace_hid(uhid_enabled);
-			free(uhid_enabled);
+			g_free(uhid_enabled);
 		} else
 			g_clear_error(&err);
 
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [BlueZ,1/3] profiles/audio: Fix uninitialized params.subgroup_data warning
  2025-08-20 14:15 [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning Bastien Nocera
  2025-08-20 14:15 ` [PATCH BlueZ 2/3] tools/tester: Fix fd leaks Bastien Nocera
  2025-08-20 14:15 ` [PATCH BlueZ 3/3] input: Fix incorrect destructors being used Bastien Nocera
@ 2025-08-20 15:52 ` bluez.test.bot
  2025-08-21 17:30 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-08-20 15:52 UTC (permalink / raw)
  To: linux-bluetooth, hadess

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=993547

---Test result---

Test Summary:
CheckPatch                    PENDING   0.27 seconds
GitLint                       PENDING   0.35 seconds
BuildEll                      PASS      20.01 seconds
BluezMake                     PASS      2580.20 seconds
MakeCheck                     PASS      20.06 seconds
MakeDistcheck                 PASS      184.29 seconds
CheckValgrind                 PASS      232.98 seconds
CheckSmatch                   PASS      304.47 seconds
bluezmakeextell               PASS      128.14 seconds
IncrementalBuild              PENDING   0.33 seconds
ScanBuild                     PASS      901.25 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning
  2025-08-20 14:15 [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning Bastien Nocera
                   ` (2 preceding siblings ...)
  2025-08-20 15:52 ` [BlueZ,1/3] profiles/audio: Fix uninitialized params.subgroup_data warning bluez.test.bot
@ 2025-08-21 17:30 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2025-08-21 17:30 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 20 Aug 2025 16:15:44 +0200 you wrote:
> profiles/audio/bass.c:923:2: uninit_use_in_call: Using uninitialized value "params". Field "params.subgroup_data" is uninitialized when calling "util_iov_append".
> ---
>  profiles/audio/bass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,1/3] profiles/audio: Fix uninitialized params.subgroup_data warning
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c773fd53c953
  - [BlueZ,2/3] tools/tester: Fix fd leaks
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=bb14a8b18f94
  - [BlueZ,3/3] input: Fix incorrect destructors being used
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4784f58ff0ec

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-21 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 14:15 [PATCH BlueZ 1/3] profiles/audio: Fix uninitialized params.subgroup_data warning Bastien Nocera
2025-08-20 14:15 ` [PATCH BlueZ 2/3] tools/tester: Fix fd leaks Bastien Nocera
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

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 NNTP newsgroup(s).