All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Bluetooth: btusb: Return when coredump trigger cmd fails
@ 2023-11-17 19:28 Manish Mandlik
  2023-11-17 19:28 ` [PATCH v2 2/2] Bluetooth: btusb: Fix double free in handle_dump_pkt_qca() Manish Mandlik
  2023-11-17 19:56 ` [v2,1/2] Bluetooth: btusb: Return when coredump trigger cmd fails bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Manish Mandlik @ 2023-11-17 19:28 UTC (permalink / raw)
  To: marcel, luiz.dentz
  Cc: chromeos-bluetooth-upstreaming, linux-bluetooth, Manish Mandlik,
	Johan Hedberg, Tim Jiang, linux-kernel

Avoid freeing NULL skb when hci command fails.

Fixes: 20981ce2d5a5 ("Bluetooth: btusb: Add WCN6855 devcoredump support")

Signed-off-by: Manish Mandlik <mmandlik@google.com>
---

Changes in v2:
- Fixed a typo in error log in btusb_coredump_qca()

 drivers/bluetooth/btusb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b8e9de887b5d..35a26440cabd 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3463,8 +3463,11 @@ static void btusb_coredump_qca(struct hci_dev *hdev)
 	struct sk_buff *skb;
 
 	skb = __hci_cmd_sync(hdev, 0xfc0c, 1, param, HCI_CMD_TIMEOUT);
-	if (IS_ERR(skb))
-		bt_dev_err(hdev, "%s: triggle crash failed (%ld)", __func__, PTR_ERR(skb));
+	if (IS_ERR(skb)) {
+		bt_dev_err(hdev, "%s: trigger crash failed (%ld)", __func__, PTR_ERR(skb));
+		return;
+	}
+
 	kfree_skb(skb);
 }
 
-- 
2.43.0.rc0.421.g78406f8d94-goog


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

end of thread, other threads:[~2023-11-17 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17 19:28 [PATCH v2 1/2] Bluetooth: btusb: Return when coredump trigger cmd fails Manish Mandlik
2023-11-17 19:28 ` [PATCH v2 2/2] Bluetooth: btusb: Fix double free in handle_dump_pkt_qca() Manish Mandlik
2023-11-17 19:56 ` [v2,1/2] Bluetooth: btusb: Return when coredump trigger cmd fails bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.