aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-05-10 05:17:40 -0400
committerSven Eckelmann <sven@narfation.org>2011-05-30 01:39:28 -0400
commit1b38bed562317701760b84cad12749985ceffb8b (patch)
treebcc3747514600704799eabf32c9f7ef517621966 /net
parente2cbc11c0e1225bd5fe183a967fc80df3db10745 (diff)
batman-adv: Use kzalloc rather than kmalloc followed by memset with 0
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/gateway_client.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 61605a0f3f39..6e036351dc3d 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -273,11 +273,10 @@ static void gw_node_add(struct bat_priv *bat_priv,
273 struct gw_node *gw_node; 273 struct gw_node *gw_node;
274 int down, up; 274 int down, up;
275 275
276 gw_node = kmalloc(sizeof(struct gw_node), GFP_ATOMIC); 276 gw_node = kzalloc(sizeof(struct gw_node), GFP_ATOMIC);
277 if (!gw_node) 277 if (!gw_node)
278 return; 278 return;
279 279
280 memset(gw_node, 0, sizeof(struct gw_node));
281 INIT_HLIST_NODE(&gw_node->list); 280 INIT_HLIST_NODE(&gw_node->list);
282 gw_node->orig_node = orig_node; 281 gw_node->orig_node = orig_node;
283 atomic_set(&gw_node->refcount, 1); 282 atomic_set(&gw_node->refcount, 1);