[TIPC]: Enhanced & cleaned up system messages; fixed 2 obscure memory leaks.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Allan Stephens
2006-06-25 23:52:17 -07:00
committed by David S. Miller
parent f131072c3d
commit a10bd924a4
13 changed files with 148 additions and 125 deletions

View File

@ -44,19 +44,24 @@
struct _zone *tipc_zone_create(u32 addr)
{
struct _zone *z_ptr = NULL;
struct _zone *z_ptr;
u32 z_num;
if (!tipc_addr_domain_valid(addr))
if (!tipc_addr_domain_valid(addr)) {
err("Zone creation failed, invalid domain 0x%x\n", addr);
return NULL;
}
z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC);
if (z_ptr != NULL) {
memset(z_ptr, 0, sizeof(*z_ptr));
z_num = tipc_zone(addr);
z_ptr->addr = tipc_addr(z_num, 0, 0);
tipc_net.zones[z_num] = z_ptr;
if (!z_ptr) {
warn("Zone creation failed, insufficient memory\n");
return NULL;
}
memset(z_ptr, 0, sizeof(*z_ptr));
z_num = tipc_zone(addr);
z_ptr->addr = tipc_addr(z_num, 0, 0);
tipc_net.zones[z_num] = z_ptr;
return z_ptr;
}