diff options
author | Anders Kaseorg <[andersk@ksplice.com]> | 2010-08-17 15:00:03 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-18 04:31:51 +0400 |
commit | f81380925209bc60732a57eef41ab440c056aacf (patch) | |
tree | d72c28aa2d101acacc733f41678a1764885b74f9 /net/tipc/core.c | |
parent | 24763d80fbb45aaf477d53c2203c929f6c41b5fc (diff) | |
download | linux-f81380925209bc60732a57eef41ab440c056aacf.tar.xz |
tipc: Fix log buffer memory leak if initialization fails
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 <andersk@ksplice.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r-- | net/tipc/core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c index 696468117985..466b861dab91 100644 --- 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); |