projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1143d45
)
Bluetooth: Cleanup blkcipher on SMP termination
author
Brian Gix
<bgix@codeaurora.org>
Wed, 23 Nov 2011 16:28:35 +0000
(08:28 -0800)
committer
Gustavo F. Padovan
<padovan@profusion.mobi>
Thu, 1 Dec 2011 13:53:46 +0000
(22:53 +0900)
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>
net/bluetooth/smp.c
patch
|
blob
|
blame
|
history
diff --git
a/net/bluetooth/smp.c
b/net/bluetooth/smp.c
index 94e94ca353848768e5bca28c3364a7b8554acdf3..b9af4885ae53e4c60852133d38ab347edadfafca 100644
(file)
--- 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)
void smp_chan_destroy(struct l2cap_conn *conn)
{
- kfree(conn->smp_chan);
+ struct smp_chan *smp = conn->smp_chan;
+
+ clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend);
+
+ if (smp->tfm)
+ crypto_free_blkcipher(smp->tfm);
+
+ kfree(smp);
+ conn->smp_chan = NULL;
hci_conn_put(conn->hcon);
}