summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sensor-hub.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-09-14 08:53:23 +0200
committerJonathan Cameron <jic23@kernel.org>2012-09-18 22:50:43 +0200
commit2b7c4b8e3edfd109a8423ff593a12a5fe09615b2 (patch)
tree3362eadd65db79a0dc440f40995a63f752e95bcc /drivers/hid/hid-sensor-hub.c
parentHID: sensors: fix up for mfd_add_devices() API change (diff)
downloadlinux-2b7c4b8e3edfd109a8423ff593a12a5fe09615b2.tar.xz
linux-2b7c4b8e3edfd109a8423ff593a12a5fe09615b2.zip
HID: sensors: use GFP_ATOMIC under spinlock
We're holding a spinlock here so we can't call kmalloc() with GFP_KERNEL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/hid/hid-sensor-hub.c')
-rw-r--r--drivers/hid/hid-sensor-hub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 4ac759c1fe22..0c93b10b0813 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;