From: Marcel Holtmann Date: Wed, 14 Jan 2015 23:43:10 +0000 (-0800) Subject: Bluetooth: Don't register any SMP channel if LE is not supported X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e7ec44564cacd4a19cca9523a7be1916b108aa6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Bluetooth: Don't register any SMP channel if LE is not supported When LE features are not supported, then do not bother registering any kind of SMP channel. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 3e4de935f667..08a9314f3ca7 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -3066,6 +3066,12 @@ int smp_register(struct hci_dev *hdev) BT_DBG("%s", hdev->name); + /* If the controller does not support Low Energy operation, then + * there is also no need to register any SMP channel. + */ + if (!lmp_le_capable(hdev)) + return 0; + chan = smp_add_cid(hdev, L2CAP_CID_SMP); if (IS_ERR(chan)) return PTR_ERR(chan);