diff options
author | Brian Gix <bgix@codeaurora.org> | 2011-11-23 11:28:35 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-01 08:53:46 -0500 |
commit | c8eb969071032defb1dc493ae28cf2e2a31193a5 (patch) | |
tree | 50d44422500b5df6cb51b591552e90cc9697ee4e /net/bluetooth | |
parent | 1143d45846f190465382dd667c7f893b9d1fd131 (diff) |
Bluetooth: Cleanup blkcipher on SMP termination
The blkcipher must be freed to avoid memory leak.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/smp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 94e94ca35384..b9af4885ae53 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -379,7 +379,15 @@ static struct smp_chan *smp_chan_create(struct l2cap_conn *conn) | |||
379 | 379 | ||
380 | void smp_chan_destroy(struct l2cap_conn *conn) | 380 | void smp_chan_destroy(struct l2cap_conn *conn) |
381 | { | 381 | { |
382 | kfree(conn->smp_chan); | 382 | struct smp_chan *smp = conn->smp_chan; |
383 | |||
384 | clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend); | ||
385 | |||
386 | if (smp->tfm) | ||
387 | crypto_free_blkcipher(smp->tfm); | ||
388 | |||
389 | kfree(smp); | ||
390 | conn->smp_chan = NULL; | ||
383 | hci_conn_put(conn->hcon); | 391 | hci_conn_put(conn->hcon); |
384 | } | 392 | } |
385 | 393 | ||