Bluetooth: fix null ptr deref on hci_sync_conn_complete_evt
authorSoenke Huster <soenke.huster@eknoes.de>
Fri, 14 Jan 2022 16:44:02 +0000 (17:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:59:01 +0000 (07:59 +0100)
commitc1aa0dd52db4ce888be0bd820c3fa918d350ca0b
treeebd17dcf924bef05d51f0f3694e8ad87d0c18d5b
parent02e61196c578390caf19b340825ea58f874f948c
Bluetooth: fix null ptr deref on hci_sync_conn_complete_evt

commit 3afee2118132e93e5f6fa636dfde86201a860ab3 upstream.

This event is just specified for SCO and eSCO link types.
On the reception of a HCI_Synchronous_Connection_Complete for a BDADDR
of an existing LE connection, LE link type and a status that triggers the
second case of the packet processing a NULL pointer dereference happens,
as conn->link is NULL.

Signed-off-by: Soenke Huster <soenke.huster@eknoes.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Ovidiu Panait <ovidiu.panait@eng.windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/hci_event.c