Skip to content

Commit

Permalink
net: tipc: name_table: Replace GFP_ATOMIC with GFP_KERNEL in tipc_nam…
Browse files Browse the repository at this point in the history
…etbl_init()

tipc_nametbl_init() is never called in atomic context.
It calls kzalloc() with GFP_ATOMIC, which is not necessary.
GFP_ATOMIC can be replaced with GFP_KERNEL.

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jia-Ju Bai authored and David S. Miller committed Jul 27, 2018
1 parent ba23dc6 commit 04b9ce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ int tipc_nametbl_init(struct net *net)
struct name_table *nt;
int i;

nt = kzalloc(sizeof(*nt), GFP_ATOMIC);
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
if (!nt)
return -ENOMEM;

Expand Down

0 comments on commit 04b9ce4

Please sign in to comment.