diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/smp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 99abffcaf16b..f1cb6a32e93f 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -589,6 +589,24 @@ void smp_chan_destroy(struct l2cap_conn *conn) | |||
589 | complete = test_bit(SMP_FLAG_COMPLETE, &smp->smp_flags); | 589 | complete = test_bit(SMP_FLAG_COMPLETE, &smp->smp_flags); |
590 | mgmt_smp_complete(conn->hcon, complete); | 590 | mgmt_smp_complete(conn->hcon, complete); |
591 | 591 | ||
592 | /* If pairing failed clean up any keys we might have */ | ||
593 | if (!complete) { | ||
594 | if (smp->ltk) { | ||
595 | list_del(&smp->ltk->list); | ||
596 | kfree(smp->ltk); | ||
597 | } | ||
598 | |||
599 | if (smp->slave_ltk) { | ||
600 | list_del(&smp->slave_ltk->list); | ||
601 | kfree(smp->slave_ltk); | ||
602 | } | ||
603 | |||
604 | if (smp->remote_irk) { | ||
605 | list_del(&smp->remote_irk->list); | ||
606 | kfree(smp->remote_irk); | ||
607 | } | ||
608 | } | ||
609 | |||
592 | kfree(smp); | 610 | kfree(smp); |
593 | conn->smp_chan = NULL; | 611 | conn->smp_chan = NULL; |
594 | conn->hcon->smp_conn = NULL; | 612 | conn->hcon->smp_conn = NULL; |