]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: tipc: bcast: Replace GFP_ATOMIC with GFP_KERNEL in tipc_bcast_init()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Fri, 27 Jul 2018 09:31:35 +0000 (17:31 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jul 2018 20:45:15 +0000 (13:45 -0700)
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>
net/tipc/bcast.c

index f3711176be4559e5707d4c75d130a7907e35afe2..9ee6cfea56dd015851302f1702f9e068803d01dd 100644 (file)
@@ -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;