Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: hci_uart: add missing NULL check in h5_enqueue

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

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

Reported-by: syzbot+b9bd12fbed3485a3e51f@syzkaller.appspotmail.com
Fixes: d9dd833cf6d2 ("Bluetooth: hci_h5: Add runtime suspend")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Pavel Skripkin and committed by
Marcel Holtmann
32cb08e9 f63d24ba

+5 -3
+5 -3
drivers/bluetooth/hci_h5.c
··· 629 629 break; 630 630 } 631 631 632 - pm_runtime_get_sync(&hu->serdev->dev); 633 - pm_runtime_mark_last_busy(&hu->serdev->dev); 634 - pm_runtime_put_autosuspend(&hu->serdev->dev); 632 + if (hu->serdev) { 633 + pm_runtime_get_sync(&hu->serdev->dev); 634 + pm_runtime_mark_last_busy(&hu->serdev->dev); 635 + pm_runtime_put_autosuspend(&hu->serdev->dev); 636 + } 635 637 636 638 return 0; 637 639 }