From: zwp Date: Thu, 12 Jul 2012 02:11:07 +0000 (+0800) Subject: solve gsensor deadlock problem. X-Git-Tag: firefly_0821_release~9014 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=33af2d2d144d88aa60835e7422be1990aebb1e55;p=firefly-linux-kernel-4.4.55.git solve gsensor deadlock problem. --- 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)