Bluetooth: Delay check for conn->smp in smp_conn_security()
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 4 Sep 2015 09:22:46 +0000 (12:22 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 17 Sep 2015 10:28:27 +0000 (12:28 +0200)
commitd8949aad3eab5d396f4fefcd581773bf07b9a79e
tree3f3f0b3c775621eef856097a6c5ef7847452f502
parent20471ed4d403a5f4de6aa0c10cd1e446f7f2b3c7
Bluetooth: Delay check for conn->smp in smp_conn_security()

There are several actions that smp_conn_security() might make that do
not require a valid SMP context (conn->smp pointer). One of these
actions is to encrypt the link with an existing LTK. If the SMP
context wasn't initialized properly we should still allow the
independent actions to be done, i.e. the check for the context should
only be done at the last possible moment.

Reported-by: Chuck Ebbert <cebbert.lkml@gmail.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org # 4.0+
net/bluetooth/smp.c