summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorSoenke Huster <soenke.huster@eknoes.de>2022-01-23 06:57:09 +0100
committerMarcel Holtmann <marcel@holtmann.org>2022-01-23 15:30:18 +0100
commit5201d23cc8e57531e0b17e41c0ae10405ba6abd3 (patch)
tree639fe5ec48cdc2c0784e10b390906d95e2f38063 /net/bluetooth
parentdb3f1f9b5d88d8d7f9eaa486f71784dd319285ff (diff)
downloadlinux-5201d23cc8e57531e0b17e41c0ae10405ba6abd3.tar.bz2
Bluetooth: msft: fix null pointer deref on msft_monitor_device_evt
msft_find_handle_data returns NULL if it can't find the handle. Therefore, handle_data must be checked, otherwise a null pointer is dereferenced. Signed-off-by: Soenke Huster <soenke.huster@eknoes.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/msft.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c
index 484540855863..9a3d77d3ca86 100644
--- a/net/bluetooth/msft.c
+++ b/net/bluetooth/msft.c
@@ -704,6 +704,8 @@ static void msft_monitor_device_evt(struct hci_dev *hdev, struct sk_buff *skb)
ev->monitor_state, &ev->bdaddr);
handle_data = msft_find_handle_data(hdev, ev->monitor_handle, false);
+ if (!handle_data)
+ return;
switch (ev->addr_type) {
case ADDR_LE_DEV_PUBLIC: