* [PATCH net-next] Bluetooth: btrtl: Fix passing zero to 'ERR_PTR'
@ 2025-06-28 10:31 Yue Haibing
2025-06-28 10:34 ` [net-next] " bluez.test.bot
2025-07-14 16:10 ` [PATCH net-next] " Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: Yue Haibing @ 2025-06-28 10:31 UTC (permalink / raw)
To: marcel, luiz.dentz, kai.heng.feng
Cc: linux-bluetooth, linux-kernel, yuehaibing
If bt_skb_alloc() fails, ret should be -ENOMEM then pass to ERR_PTR().
Fixes: 1996d9cad6ad ("Bluetooth: btrtl: Ask 8821C to drop old firmware")
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
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 7838c89e529e..6d5b37990be6 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -1137,8 +1137,10 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
if (btrtl_dev->drop_fw) {
skb = bt_skb_alloc(sizeof(*cmd), GFP_KERNEL);
- if (!skb)
+ if (!skb) {
+ ret = -ENOMEM;
goto err_free;
+ }
cmd = skb_put(skb, HCI_COMMAND_HDR_SIZE);
cmd->opcode = cpu_to_le16(0xfc66);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [net-next] Bluetooth: btrtl: Fix passing zero to 'ERR_PTR'
2025-06-28 10:31 [PATCH net-next] Bluetooth: btrtl: Fix passing zero to 'ERR_PTR' Yue Haibing
@ 2025-06-28 10:34 ` bluez.test.bot
2025-07-14 16:10 ` [PATCH net-next] " Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-06-28 10:34 UTC (permalink / raw)
To: linux-bluetooth, yuehaibing
[-- Attachment #1: Type: text/plain, Size: 2376 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=976902
---Test result---
Test Summary:
CheckPatch PENDING 0.30 seconds
GitLint PENDING 0.21 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 24.53 seconds
CheckAllWarning PASS 26.96 seconds
CheckSparse PASS 30.49 seconds
BuildKernel32 PASS 24.28 seconds
TestRunnerSetup PASS 473.69 seconds
TestRunner_l2cap-tester PASS 25.26 seconds
TestRunner_iso-tester PASS 38.34 seconds
TestRunner_bnep-tester PASS 6.11 seconds
TestRunner_mgmt-tester FAIL 135.36 seconds
TestRunner_rfcomm-tester PASS 9.49 seconds
TestRunner_sco-tester PASS 14.84 seconds
TestRunner_ioctl-tester PASS 10.43 seconds
TestRunner_mesh-tester FAIL 11.47 seconds
TestRunner_smp-tester PASS 8.63 seconds
TestRunner_userchan-tester PASS 6.32 seconds
IncrementalBuild PENDING 0.44 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
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
LL Privacy - Add Device 2 (2 Devices to AL) Failed 0.184 seconds
LL Privacy - Remove Device 3 (Disable RL) Failed 0.254 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.012 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 net-next] Bluetooth: btrtl: Fix passing zero to 'ERR_PTR'
2025-06-28 10:31 [PATCH net-next] Bluetooth: btrtl: Fix passing zero to 'ERR_PTR' Yue Haibing
2025-06-28 10:34 ` [net-next] " bluez.test.bot
@ 2025-07-14 16:10 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2025-07-14 16:10 UTC (permalink / raw)
To: Yue Haibing, linux-bluetooth, Kai-Heng Feng, Luiz Von Dentz,
Marcel Holtmann
Cc: LKML
> If bt_skb_alloc() fails, ret should be -ENOMEM then pass to ERR_PTR().
You would like to achieve a more appropriate error code for another case.
See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc6#n94
…
> +++ b/drivers/bluetooth/btrtl.c
> @@ -1137,8 +1137,10 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
>
> if (btrtl_dev->drop_fw) {
> skb = bt_skb_alloc(sizeof(*cmd), GFP_KERNEL);
> - if (!skb)
> + if (!skb) {
> + ret = -ENOMEM;
> goto err_free;
> + }
>
> cmd = skb_put(skb, HCI_COMMAND_HDR_SIZE);
…
Will it be a bit nicer to perform the desired variable assignment
after an additional label like “err_no_mem”?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-14 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28 10:31 [PATCH net-next] Bluetooth: btrtl: Fix passing zero to 'ERR_PTR' Yue Haibing
2025-06-28 10:34 ` [net-next] " bluez.test.bot
2025-07-14 16:10 ` [PATCH net-next] " Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox