Bluetooth: Prevent double register of suspend
authorAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Tue, 27 Sep 2022 16:58:15 +0000 (09:58 -0700)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 28 Sep 2022 19:16:10 +0000 (12:16 -0700)
commit4b8af331bb4d4cc8bb91c284b11b98dd1e265185
tree405cf62194795e8721993cc719b5f74a5d99e960
parent116523c8fac05d1d26f748fee7919a4ec5df67ea
Bluetooth: Prevent double register of suspend

Suspend notifier should only be registered and unregistered once per
hdev. Simplify this by only registering during driver registration and
simply exiting early when HCI_USER_CHANNEL is set.

Reported-by: syzbot <syzkaller@googlegroups.com>
Fixes: 359ee4f834f5 (Bluetooth: Unregister suspend with userchannel)
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c
net/bluetooth/hci_sock.c