projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
770a537
)
kernel/relay.c: fix potential memory leak
author
Zhouyi Zhou
<
[email protected]
>
Wed, 8 Jun 2016 22:33:53 +0000
(15:33 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 9 Jun 2016 21:23:11 +0000
(14:23 -0700)
When relay_open_buf() fails in relay_open(), code will goto free_bufs,
but chan is nowhere freed.
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Zhouyi Zhou <
[email protected]
>
Cc: Jens Axboe <
[email protected]
>
Cc: Al Viro <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/relay.c
patch
|
blob
|
history
diff --git
a/kernel/relay.c
b/kernel/relay.c
index 074994bcfa9be14336ecb06912a969f6d9546c9d..04d7cf3ef8cf932e036c7c76f6a27cefa962efc0 100644
(file)
--- a/
kernel/relay.c
+++ b/
kernel/relay.c
@@
-614,6
+614,7
@@
free_bufs:
kref_put(&chan->kref, relay_destroy_channel);
mutex_unlock(&relay_channels_mutex);
+ kfree(chan);
return NULL;
}
EXPORT_SYMBOL_GPL(relay_open);