mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 10:04:12 +08:00
batman-adv: Use kzalloc rather than kmalloc followed by memset with 0
Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
parent
e2cbc11c0e
commit
1b38bed562
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user