Skip to content

Commit 5201d23

Browse files
eknoesholtmann
authored andcommitted
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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent db3f1f9 commit 5201d23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/bluetooth/msft.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static void msft_monitor_device_evt(struct hci_dev *hdev, struct sk_buff *skb)
704704
ev->monitor_state, &ev->bdaddr);
705705

706706
handle_data = msft_find_handle_data(hdev, ev->monitor_handle, false);
707+
if (!handle_data)
708+
return;
707709

708710
switch (ev->addr_type) {
709711
case ADDR_LE_DEV_PUBLIC:

0 commit comments

Comments
 (0)