From: Sven Eckelmann Date: Tue, 10 May 2011 09:17:40 +0000 (+0200) Subject: batman-adv: Use kzalloc rather than kmalloc followed by memset with 0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b38bed562317701760b84cad12749985ceffb8b;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git batman-adv: Use kzalloc rather than kmalloc followed by memset with 0 Signed-off-by: Sven Eckelmann --- diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 61605a0f3f3..6e036351dc3 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, struct gw_node *gw_node; int down, up; - gw_node = kmalloc(sizeof(struct gw_node), GFP_ATOMIC); + gw_node = kzalloc(sizeof(struct gw_node), GFP_ATOMIC); if (!gw_node) return; - memset(gw_node, 0, sizeof(struct gw_node)); INIT_HLIST_NODE(&gw_node->list); gw_node->orig_node = orig_node; atomic_set(&gw_node->refcount, 1);