Skip to content

Commit

Permalink
net: tipc: bcast: Replace GFP_ATOMIC with GFP_KERNEL in tipc_bcast_in…
Browse files Browse the repository at this point in the history
…it()

tipc_bcast_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 04b9ce4 commit a073254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ int tipc_bcast_init(struct net *net)
struct tipc_bc_base *bb = NULL;
struct tipc_link *l = NULL;

bb = kzalloc(sizeof(*bb), GFP_ATOMIC);
bb = kzalloc(sizeof(*bb), GFP_KERNEL);
if (!bb)
goto enomem;
tn->bcbase = bb;
Expand Down

0 comments on commit a073254

Please sign in to comment.