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:
24763d8
)
tipc: Fix log buffer memory leak if initialization fails
author
Anders Kaseorg
<[
[email protected]
]>
Tue, 17 Aug 2010 11:00:03 +0000
(11:00 +0000)
committer
David S. Miller
<
[email protected]
>
Wed, 18 Aug 2010 00:31:51 +0000
(17:31 -0700)
Moves log buffer cleanup into tipc_core_stop() so that memory allocated
for the log buffer is freed if tipc_core_start() is unsuccessful.
Signed-off-by: Anders Kaseorg <
[email protected]
>
Signed-off-by: Allan Stephens <
[email protected]
>
Signed-off-by: Paul Gortmaker <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/tipc/core.c
patch
|
blob
|
history
diff --git
a/net/tipc/core.c
b/net/tipc/core.c
index 69646811798542cb29b37e66dd424679464a30a9..466b861dab91acb0fb6fbcab76e24585e755fd48 100644
(file)
--- a/
net/tipc/core.c
+++ b/
net/tipc/core.c
@@
-169,6
+169,7
@@
void tipc_core_stop(void)
tipc_nametbl_stop();
tipc_ref_table_stop();
tipc_socket_stop();
+ tipc_log_resize(0);
}
/**
@@
-203,7
+204,9
@@
static int __init tipc_init(void)
{
int res;
- tipc_log_resize(CONFIG_TIPC_LOG);
+ if (tipc_log_resize(CONFIG_TIPC_LOG) != 0)
+ warn("Unable to create log buffer\n");
+
info("Activated (version " TIPC_MOD_VER
" compiled " __DATE__ " " __TIME__ ")\n");
@@
-230,7
+233,6
@@
static void __exit tipc_exit(void)
tipc_core_stop_net();
tipc_core_stop();
info("Deactivated\n");
- tipc_log_resize(0);
}
module_init(tipc_init);