linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] HID: sensors: use GFP_ATOMIC under spinlock
@ 2012-09-14  6:53 Dan Carpenter
  2012-09-17 10:59 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-09-14  6:53 UTC (permalink / raw)
  To: srinivas pandruvada; +Cc: Jiri Kosina, linux-input, kernel-janitors

We're holding a spinlock here so we can't call kmalloc() with
GFP_KERNEL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 4ac759c..0c93b10 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -173,7 +173,7 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
 			spin_unlock(&pdata->dyn_callback_lock);
 			return -EINVAL;
 		}
-	callback = kzalloc(sizeof(*callback), GFP_KERNEL);
+	callback = kzalloc(sizeof(*callback), GFP_ATOMIC);
 	if (!callback) {
 		spin_unlock(&pdata->dyn_callback_lock);
 		return -ENOMEM;
@@ -462,7 +462,7 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
 		if (pdata->pending.status && pdata->pending.attr_usage_id ==
 				report->field[i]->usage->hid) {
 			hid_dbg(hdev, "data was pending ...\n");
-			pdata->pending.raw_data = kmalloc(sz, GFP_KERNEL);
+			pdata->pending.raw_data = kmalloc(sz, GFP_ATOMIC);
 			if (pdata->pending.raw_data) {
 				memcpy(pdata->pending.raw_data, ptr, sz);
 				pdata->pending.raw_size  = sz;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-17 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14  6:53 [patch 1/2] HID: sensors: use GFP_ATOMIC under spinlock Dan Carpenter
2012-09-17 10:59 ` Jiri Kosina
2012-09-17 15:21   ` Pandruvada, Srinivas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).