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)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:09:01 +0000 (13:09 +0000)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/kernel/ldc.c

index fa4c900a0d1ff8bbd78bf000b8a8feff54f5777c..62983d77455e60a3239a178ea635868a5b4f0531 100644 (file)
@@ -2306,7 +2306,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);