diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/tipc/port.c | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff) |
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/port.c')
-rw-r--r-- | net/tipc/port.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c index 3251c8d8e53c..b9c8c6b9e94f 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -226,12 +226,11 @@ u32 tipc_createport_raw(void *usr_handle, | |||
226 | struct tipc_msg *msg; | 226 | struct tipc_msg *msg; |
227 | u32 ref; | 227 | u32 ref; |
228 | 228 | ||
229 | p_ptr = kmalloc(sizeof(*p_ptr), GFP_ATOMIC); | 229 | p_ptr = kzalloc(sizeof(*p_ptr), GFP_ATOMIC); |
230 | if (!p_ptr) { | 230 | if (!p_ptr) { |
231 | warn("Port creation failed, no memory\n"); | 231 | warn("Port creation failed, no memory\n"); |
232 | return 0; | 232 | return 0; |
233 | } | 233 | } |
234 | memset(p_ptr, 0, sizeof(*p_ptr)); | ||
235 | ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock); | 234 | ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock); |
236 | if (!ref) { | 235 | if (!ref) { |
237 | warn("Port creation failed, reference table exhausted\n"); | 236 | warn("Port creation failed, reference table exhausted\n"); |
@@ -1058,7 +1057,7 @@ int tipc_createport(u32 user_ref, | |||
1058 | struct port *p_ptr; | 1057 | struct port *p_ptr; |
1059 | u32 ref; | 1058 | u32 ref; |
1060 | 1059 | ||
1061 | up_ptr = (struct user_port *)kmalloc(sizeof(*up_ptr), GFP_ATOMIC); | 1060 | up_ptr = kmalloc(sizeof(*up_ptr), GFP_ATOMIC); |
1062 | if (!up_ptr) { | 1061 | if (!up_ptr) { |
1063 | warn("Port creation failed, no memory\n"); | 1062 | warn("Port creation failed, no memory\n"); |
1064 | return -ENOMEM; | 1063 | return -ENOMEM; |