solve gsensor deadlock problem.
authorzwp <zwp@rock-chips.com>
Thu, 12 Jul 2012 02:11:07 +0000 (10:11 +0800)
committerzwp <zwp@rock-chips.com>
Thu, 12 Jul 2012 02:11:47 +0000 (10:11 +0800)
drivers/input/sensors/sensor-dev.c

index 3b20fcbb33ff36e610c6321888da4400c24fba52..2dc9b8676d52ac017d3dd884297fea888e0f7daf 100755 (executable)
@@ -447,8 +447,10 @@ static long gsensor_dev_ioctl(struct file *file,
                DBG("%s:GSENSOR_IOCTL_APP_SET_RATE start\n", __func__);         \r
                mutex_lock(&sensor->operation_mutex);   \r
                result = sensor_reset_rate(client, rate);\r
-               if (result < 0)\r
-               goto error;\r
+               if (result < 0){\r
+                       mutex_unlock(&sensor->operation_mutex);\r
+                       goto error;\r
+               }\r
                if(sensor->status_cur == SENSOR_OFF)\r
                {               \r
                        if(sensor->pdata->irq_enable)\r