2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 06:04:14 +08:00

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>
This commit is contained in:
Soenke Huster 2022-01-23 06:57:09 +01:00 committed by Marcel Holtmann
parent db3f1f9b5d
commit 5201d23cc8

View File

@ -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: