diff options
author | Edward Adam Davis <eadavis@qq.com> | 2024-01-18 12:40:34 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-13 12:50:15 +0200 |
commit | ec2049fb2b8be3e108fe2ef1f1040f91e72c9990 (patch) | |
tree | 40a7cb199363fbdd7fc22152f523d3849c5e4598 | |
parent | be2b6bcc936ae17f42fff6494106a5660b35d8d3 (diff) | |
download | linux-stable-ec2049fb2b8be3e108fe2ef1f1040f91e72c9990.tar.gz linux-stable-ec2049fb2b8be3e108fe2ef1f1040f91e72c9990.tar.bz2 linux-stable-ec2049fb2b8be3e108fe2ef1f1040f91e72c9990.zip |
Bluetooth: btintel: Fix null ptr deref in btintel_read_version
[ Upstream commit b79e040910101b020931ba0c9a6b77e81ab7f645 ]
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: syzbot+830d9e3fa61968246abd@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/bluetooth/btintel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index 5270d5513201..6a3c0ad9f10c 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -355,7 +355,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); |