aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/0001-Staging-hv-fix-sleeping-while-atomic-issue.patch
blob: 1133c7591bf6afc61022e30a7303e74876ad35e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 6ee51b8d69833b3cd00901999c36c59fbfde24aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 10 Dec 2010 16:23:26 +0200
Subject: [PATCH] Staging: hv: fix sleeping while atomic issue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

osd_schedule_callback() is called from VmbusOnMsgDPC() which runs
in a tasklet. Avoid possible sleeping by using GFP_ATOMIC for the
memory allocation.

Seems to fix #16701.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16701
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
 drivers/staging/hv/osd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index 8c3eb27..eb9b20d 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -214,7 +214,7 @@ int osd_schedule_callback(struct workqueue_struct *wq,
 {
 	struct osd_callback_struct *cb;
 
-	cb = kmalloc(sizeof(*cb), GFP_KERNEL);
+	cb = kmalloc(sizeof(*cb), GFP_ATOMIC);
 	if (!cb) {
 		printk(KERN_ERR "unable to allocate memory in osd_schedule_callback\n");
 		return -1;
-- 
1.7.1