aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Adam Davis <[email protected]>2024-01-18 04:40:34 +0000
committerLuiz Augusto von Dentz <[email protected]>2024-03-06 22:22:39 +0000
commitb79e040910101b020931ba0c9a6b77e81ab7f645 (patch)
tree548ef5791003c0c73077e513d439499efbd2bfcf
parentBluetooth: Remove usage of the deprecated ida_simple_xx() API (diff)
downloadkernel-b79e040910101b020931ba0c9a6b77e81ab7f645.tar.gz
kernel-b79e040910101b020931ba0c9a6b77e81ab7f645.zip
Bluetooth: btintel: Fix null ptr deref in btintel_read_version
If hci_cmd_sync_complete() is triggered and skb is NULL, then hdev->req_skb is NULL, which will cause this issue. Reported-and-tested-by: [email protected] Signed-off-by: Edward Adam Davis <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
-rw-r--r--drivers/bluetooth/btintel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index cdc5c08824a0..e5b043d96207 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -435,7 +435,7 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
struct sk_buff *skb;
skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT);
- if (IS_ERR(skb)) {
+ if (IS_ERR_OR_NULL(skb)) {
bt_dev_err(hdev, "Reading Intel version information failed (%ld)",
PTR_ERR(skb));
return PTR_ERR(skb);