1 From patchwork Tue Apr 21 14:30:41 2015
2 Content-Type: text/plain; charset="utf-8"
4 Content-Transfer-Encoding: 7bit
5 Subject: sparc: Use GFP_ATOMIC in ldc_alloc_exp_dring() as it can be called in
7 From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
9 Message-Id: <1429626641-199974-1-git-send-email-sowmini.varadhan@oracle.com>
10 To: sowmini.varadhan@oracle.com, sparclinux@vger.kernel.org
11 Cc: david.stevens@oracle.com, davem@davemloft.net
12 Date: Tue, 21 Apr 2015 10:30:41 -0400
14 From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
16 Upstream commit 671d773297969bebb1732e1cdc1ec03aa53c6be2
18 Since it is possible for vnet_event_napi to end up doing
19 vnet_control_pkt_engine -> ... -> vnet_send_attr ->
20 vnet_port_alloc_tx_ring -> ldc_alloc_exp_dring -> kzalloc()
21 (i.e., in softirq context), kzalloc() should be called with
22 GFP_ATOMIC from ldc_alloc_exp_dring.
24 Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 arch/sparc/kernel/ldc.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
30 --- a/arch/sparc/kernel/ldc.c
31 +++ b/arch/sparc/kernel/ldc.c
32 @@ -2313,7 +2313,7 @@ void *ldc_alloc_exp_dring(struct ldc_cha
34 return ERR_PTR(-EINVAL);
36 - buf = kzalloc(len, GFP_KERNEL);
37 + buf = kzalloc(len, GFP_ATOMIC);
39 return ERR_PTR(-ENOMEM);