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:
14e138a
)
tipc: error path leak fixes in tipc_enable_bearer()
author
Tommi Rantala
<
[email protected]
>
Fri, 22 Dec 2017 07:35:16 +0000
(09:35 +0200)
committer
David S. Miller
<
[email protected]
>
Wed, 27 Dec 2017 15:54:59 +0000
(10:54 -0500)
Fix memory leak in tipc_enable_bearer() if enable_media() fails, and
cleanup with bearer_disable() if tipc_mon_create() fails.
Acked-by: Ying Xue <
[email protected]
>
Acked-by: Jon Maloy <
[email protected]
>
Signed-off-by: Tommi Rantala <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/tipc/bearer.c
patch
|
blob
|
history
diff --git
a/net/tipc/bearer.c
b/net/tipc/bearer.c
index 47ec121574ce4ef95850f688d85b50eff766a710..c8001471da6c3c53be6c63dde1311302b093f415 100644
(file)
--- a/
net/tipc/bearer.c
+++ b/
net/tipc/bearer.c
@@
-324,6
+324,7
@@
restart:
if (res) {
pr_warn("Bearer <%s> rejected, enable failure (%d)\n",
name, -res);
+ kfree(b);
return -EINVAL;
}
@@
-347,8
+348,10
@@
restart:
if (skb)
tipc_bearer_xmit_skb(net, bearer_id, skb, &b->bcast_addr);
- if (tipc_mon_create(net, bearer_id))
+ if (tipc_mon_create(net, bearer_id)) {
+ bearer_disable(net, b);
return -ENOMEM;
+ }
pr_info("Enabled bearer <%s>, discovery domain %s, priority %u\n",
name,