isdn: mISDN: netjet: Replace GFP_ATOMIC with GFP_KERNEL in nj_probe()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Fri, 27 Jul 2018 02:41:09 +0000 (10:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jul 2018 04:21:23 +0000 (21:21 -0700)
nj_probe() 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>
drivers/isdn/hardware/mISDN/netjet.c

index 89d9ba8ed535e2bf25ad807add639b0240942e3a..2b317cb63d068c00938fefed7e22cc8cfb27156f 100644 (file)
@@ -1084,7 +1084,7 @@ nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
-       card = kzalloc(sizeof(struct tiger_hw), GFP_ATOMIC);
+       card = kzalloc(sizeof(struct tiger_hw), GFP_KERNEL);
        if (!card) {
                pr_info("No kmem for Netjet\n");
                return err;