]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/tipc/zone.c
tc35815: Fix receiver hangup on Rx FIFO overflow
[linux-2.6-omap-h63xx.git] / net / tipc / zone.c
index 316c4872ff5bd42b59b27cf6a56bcf58f6ea8430..3506f856344162669d43a7b63ffebb6b04da0807 100644 (file)
@@ -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.
@@ -52,13 +52,12 @@ struct _zone *tipc_zone_create(u32 addr)
                return NULL;
        }
 
-       z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC);
+       z_ptr = kzalloc(sizeof(*z_ptr), GFP_ATOMIC);
        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;
@@ -83,7 +82,7 @@ void tipc_zone_attach_cluster(struct _zone *z_ptr, struct cluster *c_ptr)
 
        assert(c_ptr->addr);
        assert(c_num <= tipc_max_clusters);
-       assert(z_ptr->clusters[c_num] == 0);
+       assert(z_ptr->clusters[c_num] == NULL);
        z_ptr->clusters[c_num] = c_ptr;
 }
 
@@ -93,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);
                }
        }