Bluetooth: hci_uart: fix GPF in h5_recv
authorPavel Skripkin <paskripkin@gmail.com>
Thu, 2 Sep 2021 20:27:56 +0000 (23:27 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 10 Sep 2021 07:38:43 +0000 (09:38 +0200)
commit2fc7acb69fa3573d4bf7a90c323296d840daf330
tree600ded4192239f3b2981dd42aad95633802f9e41
parent8bba13b1d08d42e2e8308924fa5c1551a7b2b011
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: d9dd833cf6d2 ("Bluetooth: hci_h5: Add runtime suspend")
Reported-and-tested-by: syzbot+7d41312fe3f123a6f605@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_h5.c