public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure
@ 2025-07-05 10:52 Zhongqiu Han
  2025-07-05 11:31 ` bluez.test.bot
  2025-07-10 17:32 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Zhongqiu Han @ 2025-07-05 10:52 UTC (permalink / raw)
  To: marcel, luiz.dentz, chharry; +Cc: linux-bluetooth, linux-kernel, quic_zhonhan

Avoid potential NULL pointer dereference by checking the return value of
kmalloc and handling allocation failure properly.

Fixes: 7d70989fcea7 ("Bluetooth: btusb: Add HCI Drv commands for configuring altsetting")
Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
---
 drivers/bluetooth/btusb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index f8f256ff79a3..642b3238ea39 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3799,6 +3799,8 @@ static int btusb_hci_drv_supported_altsettings(struct hci_dev *hdev, void *data,
 
 	/* There are at most 7 alt (0 - 6) */
 	rp = kmalloc(sizeof(*rp) + 7, GFP_KERNEL);
+	if (!rp)
+		return -ENOMEM;
 
 	rp->num = 0;
 	if (!drvdata->isoc)
-- 
2.43.0


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

* RE: Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure
  2025-07-05 10:52 [PATCH] Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure Zhongqiu Han
@ 2025-07-05 11:31 ` bluez.test.bot
  2025-07-10 17:32 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-07-05 11:31 UTC (permalink / raw)
  To: linux-bluetooth, quic_zhonhan

[-- Attachment #1: Type: text/plain, Size: 2028 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=979318

---Test result---

Test Summary:
CheckPatch                    PENDING   0.29 seconds
GitLint                       PENDING   0.21 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      24.24 seconds
CheckAllWarning               PASS      26.69 seconds
CheckSparse                   PASS      30.11 seconds
BuildKernel32                 PASS      24.23 seconds
TestRunnerSetup               PASS      468.93 seconds
TestRunner_l2cap-tester       PASS      25.27 seconds
TestRunner_iso-tester         PASS      36.10 seconds
TestRunner_bnep-tester        PASS      5.92 seconds
TestRunner_mgmt-tester        PASS      131.77 seconds
TestRunner_rfcomm-tester      PASS      9.43 seconds
TestRunner_sco-tester         PASS      14.67 seconds
TestRunner_ioctl-tester       PASS      10.02 seconds
TestRunner_mesh-tester        FAIL      11.37 seconds
TestRunner_smp-tester         PASS      8.54 seconds
TestRunner_userchan-tester    PASS      6.24 seconds
IncrementalBuild              PENDING   0.85 seconds

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

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

##############################
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.207 seconds
Mesh - Send cancel - 2                               Timed out    1.999 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: btusb: Fix potential NULL dereference on kmalloc failure
  2025-07-05 10:52 [PATCH] Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure Zhongqiu Han
  2025-07-05 11:31 ` bluez.test.bot
@ 2025-07-10 17:32 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-10 17:32 UTC (permalink / raw)
  To: Zhongqiu Han; +Cc: marcel, luiz.dentz, chharry, 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 Sat, 5 Jul 2025 18:52:46 +0800 you wrote:
> Avoid potential NULL pointer dereference by checking the return value of
> kmalloc and handling allocation failure properly.
> 
> Fixes: 7d70989fcea7 ("Bluetooth: btusb: Add HCI Drv commands for configuring altsetting")
> Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
> ---
>  drivers/bluetooth/btusb.c | 2 ++
>  1 file changed, 2 insertions(+)

Here is the summary with links:
  - Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure
    https://git.kernel.org/bluetooth/bluetooth-next/c/982ac6d394db

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-07-10 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-05 10:52 [PATCH] Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure Zhongqiu Han
2025-07-05 11:31 ` bluez.test.bot
2025-07-10 17:32 ` [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