Bluetooth: MGMT: Add error handling to pair_device()
authorGriffin Kroah-Hartman <griffin@kroah.com>
Thu, 15 Aug 2024 11:51:00 +0000 (13:51 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 15 Aug 2024 17:09:35 +0000 (13:09 -0400)
commit538fd3921afac97158d4177139a0ad39f056dbb2
treeb66d1ec4fd24621a870a13d7f3890a8e7c69cc0a
parent28cd47f75185c4818b0fb1b46f2f02faaba96376
Bluetooth: MGMT: Add error handling to pair_device()

hci_conn_params_add() never checks for a NULL value and could lead to a NULL
pointer dereference causing a crash.

Fixed by adding error handling in the function.

Cc: Stable <stable@kernel.org>
Fixes: 5157b8a503fa ("Bluetooth: Fix initializing conn_params in scan phase")
Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com>
Reported-by: Yiwei Zhang <zhan4630@purdue.edu>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c