public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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