提交 1b38bed5 编写于 作者: S Sven Eckelmann

batman-adv: Use kzalloc rather than kmalloc followed by memset with 0

Signed-off-by: NSven Eckelmann <sven@narfation.org>
上级 e2cbc11c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册