[PATCH] Staging: hv: fix sleeping while atomic issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
Cc: Hank Janssen <hjanssen@xxxxxxxxxxxxx>
Signed-off-by: Timo TerÃs <timo.teras@xxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux