Skip to content

Commit

Permalink
batman-adv: Use kzalloc rather than kmalloc followed by memset with 0
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Eckelmann <sven@narfation.org>
  • Loading branch information
Sven Eckelmann committed May 30, 2011
1 parent e2cbc11 commit 1b38bed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/batman-adv/gateway_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1b38bed

Please sign in to comment.