From 33af2d2d144d88aa60835e7422be1990aebb1e55 Mon Sep 17 00:00:00 2001 From: zwp Date: Thu, 12 Jul 2012 10:11:07 +0800 Subject: [PATCH] solve gsensor deadlock problem. --- drivers/input/sensors/sensor-dev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/sensors/sensor-dev.c b/drivers/input/sensors/sensor-dev.c index 3b20fcbb33ff..2dc9b8676d52 100755 --- a/drivers/input/sensors/sensor-dev.c +++ b/drivers/input/sensors/sensor-dev.c @@ -447,8 +447,10 @@ static long gsensor_dev_ioctl(struct file *file, DBG("%s:GSENSOR_IOCTL_APP_SET_RATE start\n", __func__); mutex_lock(&sensor->operation_mutex); result = sensor_reset_rate(client, rate); - if (result < 0) - goto error; + if (result < 0){ + mutex_unlock(&sensor->operation_mutex); + goto error; + } if(sensor->status_cur == SENSOR_OFF) { if(sensor->pdata->irq_enable) -- 2.34.1