]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.0.8/sparc-Use-GFP_ATOMIC-in-ldc_alloc_exp_dring-as-it-can-be-called-in-softirq-context.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.0.8 / sparc-Use-GFP_ATOMIC-in-ldc_alloc_exp_dring-as-it-can-be-called-in-softirq-context.patch
1 From patchwork Tue Apr 21 14:30:41 2015
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: sparc: Use GFP_ATOMIC in ldc_alloc_exp_dring() as it can be called in
6 softirq context
7 From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
8 X-Patchwork-Id: 463148
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
13
14 From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
15
16 Upstream commit 671d773297969bebb1732e1cdc1ec03aa53c6be2
17
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.
23
24 Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 ---
27 arch/sparc/kernel/ldc.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
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
33 if (len & (8UL - 1))
34 return ERR_PTR(-EINVAL);
35
36 - buf = kzalloc(len, GFP_KERNEL);
37 + buf = kzalloc(len, GFP_ATOMIC);
38 if (!buf)
39 return ERR_PTR(-ENOMEM);
40