Bluetooth: SMP: Fix missing buffer unref for LE SC only mode

If pairing is rejected due to unsatisfying auth requirements
pending response buffer should be freed.

Change-Id: I8bbdad5fac8cd6dbcd674c7ad9725cf44ef79004
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2015-12-18 15:30:14 +01:00 committed by Anas Nashif
commit 075e2c430a

View file

@ -1545,6 +1545,7 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf)
#if defined(CONFIG_BLUETOOTH_SMP_SC_ONLY)
if (!atomic_test_bit(&smp->flags, SMP_FLAG_SC) ||
smp->method == JUST_WORKS) {
net_buf_unref(rsp_buf);
return BT_SMP_ERR_AUTH_REQUIREMENTS;
}
#endif/* CONFIG_BLUETOOTH_SMP_SC_ONLY */