Skip to content

Commit

Permalink
Bluetooth: msft: fix null pointer deref on msft_monitor_device_evt
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Soenke Huster authored and Marcel Holtmann committed Jan 23, 2022
1 parent db3f1f9 commit 5201d23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/bluetooth/msft.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5201d23

Please sign in to comment.