Commit ed119770 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Jiri Kosina

HID: sensor-hub: correct dyn_callback_lock IRQ-safe change

Commit 0ccf091d ("HID: sensor-hub:
make dyn_callback_lock IRQ-safe) was supposed to change locks
in sensor_hub_get_callback(), but missed.
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent f9d904ac
...@@ -135,8 +135,9 @@ static struct hid_sensor_hub_callbacks *sensor_hub_get_callback( ...@@ -135,8 +135,9 @@ static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
{ {
struct hid_sensor_hub_callbacks_list *callback; struct hid_sensor_hub_callbacks_list *callback;
struct sensor_hub_data *pdata = hid_get_drvdata(hdev); struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
unsigned long flags;
spin_lock(&pdata->dyn_callback_lock); spin_lock_irqsave(&pdata->dyn_callback_lock, flags);
list_for_each_entry(callback, &pdata->dyn_callback_list, list) list_for_each_entry(callback, &pdata->dyn_callback_list, list)
if (callback->usage_id == usage_id && if (callback->usage_id == usage_id &&
(collection_index >= (collection_index >=
...@@ -145,10 +146,11 @@ static struct hid_sensor_hub_callbacks *sensor_hub_get_callback( ...@@ -145,10 +146,11 @@ static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
callback->hsdev->end_collection_index)) { callback->hsdev->end_collection_index)) {
*priv = callback->priv; *priv = callback->priv;
*hsdev = callback->hsdev; *hsdev = callback->hsdev;
spin_unlock(&pdata->dyn_callback_lock); spin_unlock_irqrestore(&pdata->dyn_callback_lock,
flags);
return callback->usage_callback; return callback->usage_callback;
} }
spin_unlock(&pdata->dyn_callback_lock); spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment