]> git.hungrycats.org Git - linux/commitdiff
sparc: Use GFP_ATOMIC in ldc_alloc_exp_dring() as it can be called in softirq context
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Tue, 21 Apr 2015 14:30:41 +0000 (10:30 -0400)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 5 Jul 2015 14:12:57 +0000 (10:12 -0400)
[ Upstream commit 671d773297969bebb1732e1cdc1ec03aa53c6be2 ]

Since it is possible for vnet_event_napi to end up doing
vnet_control_pkt_engine -> ... -> vnet_send_attr ->
vnet_port_alloc_tx_ring -> ldc_alloc_exp_dring -> kzalloc()
(i.e., in softirq context), kzalloc() should be called with
GFP_ATOMIC from ldc_alloc_exp_dring.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/sparc/kernel/ldc.c

index 4310332872d4cf90727b1e91b900dcbe601d296f..71762565513e1a62a5492755077d40b05b141a5d 100644 (file)
@@ -2307,7 +2307,7 @@ void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len,
        if (len & (8UL - 1))
                return ERR_PTR(-EINVAL);
 
-       buf = kzalloc(len, GFP_KERNEL);
+       buf = kzalloc(len, GFP_ATOMIC);
        if (!buf)
                return ERR_PTR(-ENOMEM);