X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Ftipc%2Fzone.c;h=114e173f11a5fbbb6b459219984778fe44ebd2d8;hb=dafdec746f8c468bebf6b99f32a392ee6c8d0212;hp=2803e1b4f17065d2e4988684a527da23221eba98;hpb=ca94f26d2b2ee8ad76be617b35f846444fedc07b;p=linux-2.6-omap-h63xx.git diff --git a/net/tipc/zone.c b/net/tipc/zone.c index 2803e1b4f17..114e173f11a 100644 --- a/net/tipc/zone.c +++ b/net/tipc/zone.c @@ -1,6 +1,6 @@ /* * net/tipc/zone.c: TIPC zone management routines - * + * * Copyright (c) 2000-2006, Ericsson AB * Copyright (c) 2005, Wind River Systems * All rights reserved. @@ -44,19 +44,23 @@ 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; + z_ptr = kzalloc(sizeof(*z_ptr), GFP_ATOMIC); + if (!z_ptr) { + warn("Zone creation failed, insufficient memory\n"); + return NULL; } + + z_num = tipc_zone(addr); + z_ptr->addr = tipc_addr(z_num, 0, 0); + tipc_net.zones[z_num] = z_ptr; return z_ptr; } @@ -88,7 +92,7 @@ void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router) for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { if (z_ptr->clusters[c_num]) { - tipc_cltr_remove_as_router(z_ptr->clusters[c_num], + tipc_cltr_remove_as_router(z_ptr->clusters[c_num], router); } }