* [PATCH] Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2()
@ 2025-10-28 17:56 Abdun Nihaal
2025-10-28 18:42 ` bluez.test.bot
2025-10-28 21:30 ` [PATCH] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Abdun Nihaal @ 2025-10-28 17:56 UTC (permalink / raw)
To: marcel; +Cc: Abdun Nihaal, luiz.dentz, linux-bluetooth, linux-kernel
The memory allocated for ptr using kvmalloc() is not freed on the last
error path. Fix that by freeing it on that error path.
Fixes: 9a24ce5e29b1 ("Bluetooth: btrtl: Firmware format v2 support")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
---
Compile tested only. Issue found using static analysis.
drivers/bluetooth/btrtl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 6abd962502e3..1d4a7887abcc 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -625,8 +625,10 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
len += entry->len;
}
- if (!len)
+ if (!len) {
+ kvfree(ptr);
return -EPERM;
+ }
*_buf = ptr;
return len;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2()
2025-10-28 17:56 [PATCH] Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2() Abdun Nihaal
@ 2025-10-28 18:42 ` bluez.test.bot
2025-10-28 21:30 ` [PATCH] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-10-28 18:42 UTC (permalink / raw)
To: linux-bluetooth, nihaal
[-- Attachment #1: Type: text/plain, Size: 2509 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=1016868
---Test result---
Test Summary:
CheckPatch PENDING 0.40 seconds
GitLint PENDING 0.28 seconds
SubjectPrefix PASS 0.11 seconds
BuildKernel PASS 24.81 seconds
CheckAllWarning PASS 29.72 seconds
CheckSparse PASS 31.85 seconds
BuildKernel32 PASS 24.62 seconds
TestRunnerSetup PASS 495.91 seconds
TestRunner_l2cap-tester PASS 23.79 seconds
TestRunner_iso-tester FAIL 40.99 seconds
TestRunner_bnep-tester PASS 6.07 seconds
TestRunner_mgmt-tester FAIL 111.02 seconds
TestRunner_rfcomm-tester PASS 9.17 seconds
TestRunner_sco-tester PASS 14.27 seconds
TestRunner_ioctl-tester PASS 9.94 seconds
TestRunner_mesh-tester FAIL 11.50 seconds
TestRunner_smp-tester PASS 8.37 seconds
TestRunner_userchan-tester PASS 6.49 seconds
IncrementalBuild PENDING 0.75 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
No test result found
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 484 (98.8%), Failed: 2, Not Run: 4
Failed Test Cases
Read Exp Feature - Success Failed 0.097 seconds
LL Privacy - Start Discovery 1 (Disable RL) Failed 0.173 seconds
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0
Failed Test Cases
Mesh - Send cancel - 1 Timed out 2.053 seconds
Mesh - Send cancel - 2 Timed out 1.996 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2()
2025-10-28 17:56 [PATCH] Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2() Abdun Nihaal
2025-10-28 18:42 ` bluez.test.bot
@ 2025-10-28 21:30 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-10-28 21:30 UTC (permalink / raw)
To: Abdun Nihaal; +Cc: marcel, luiz.dentz, linux-bluetooth, linux-kernel
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Tue, 28 Oct 2025 23:26:30 +0530 you wrote:
> The memory allocated for ptr using kvmalloc() is not freed on the last
> error path. Fix that by freeing it on that error path.
>
> Fixes: 9a24ce5e29b1 ("Bluetooth: btrtl: Firmware format v2 support")
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
> ---
> Compile tested only. Issue found using static analysis.
>
> [...]
Here is the summary with links:
- Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2()
https://git.kernel.org/bluetooth/bluetooth-next/c/4a3855790fba
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] 3+ messages in thread
end of thread, other threads:[~2025-10-28 21:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 17:56 [PATCH] Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2() Abdun Nihaal
2025-10-28 18:42 ` bluez.test.bot
2025-10-28 21:30 ` [PATCH] " 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