Commit 2fc7acb6 authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Marcel Holtmann
Browse files

Bluetooth: hci_uart: fix GPF in h5_recv



Syzbot hit general protection fault in h5_recv(). The problem was in
missing NULL check.

hu->serdev can be NULL and we cannot blindly pass &serdev->dev
somewhere, since it can cause GPF.

Fixes: d9dd833c ("Bluetooth: hci_h5: Add runtime suspend")
Reported-and-tested-by: default avatar <syzbot+7d41312fe3f123a6f605@syzkaller.appspotmail.com>
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 8bba13b1
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -587,9 +587,11 @@ static int h5_recv(struct hci_uart *hu, const void *data, int count)
		count -= processed;
	}

	if (hu->serdev) {
		pm_runtime_get(&hu->serdev->dev);
		pm_runtime_mark_last_busy(&hu->serdev->dev);
		pm_runtime_put_autosuspend(&hu->serdev->dev);
	}

	return 0;
}