staging: iio: light: isl29018: Add missing mutex_unlock on error path
Subsystems (3)
PATCH 1/1 staging: iio: light: isl29018: Add missing mutex_unlock on error path
This patch fixes the following warning:
drivers/staging/iio/light/isl29018.c:386 isl29018_write_raw() warn:
inconsistent returns 'mutex:&chip->lock'.
Locked on: line 374
Unlocked on: line 386
Signed-off-by Roberta Dobrescu <[email protected]>
Reported-by Dan Carpenter <[email protected]>
--- drivers/staging/iio/light/isl29018.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/iio/light/isl29018.c +3 -1
@@ -370,8 +370,10 @@ static int isl29018_write_raw(struct iio_dev *indio_dev,break ;case IIO_CHAN_INFO_INT_TIME :if (chan->type ==IIO_LIGHT ) -if (val !=0 ) +if (val !=0 ) { +mutex_unlock (&chip->lock);return -EINVAL ; + } ret =isl29018_set_integration_time (chip, val2);break ;case IIO_CHAN_INFO_SCALE :
Signature · 1 line
1.9.1
Jonathan Cameron
maintainerQuoted 9 lines · Roberta Dobrescu
This patch fixes the following warning:
drivers/staging/iio/light/isl29018.c:386isl29018_write_raw()warn:
inconsistent returns 'mutex:&chip->lock'.
Locked on: line 374
Unlocked on: line 386Signed-off-by Roberta Dobrescu <[email protected]>Reported-by Dan Carpenter <[email protected]>
I applied this as a fixup rather than a separate patch.
Anyhow, new testing and togreg branches should have this fixed.
Quoted 21 lines
--- drivers/staging/iio/light/isl29018.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/staging/iio/light/isl29018.c +3
-1@@ -370,8 +370,10 @@ static int isl29018_write_raw(struct iio_dev *indio_dev,break ;case IIO_CHAN_INFO_INT_TIME :if (chan->type ==IIO_LIGHT ) -if (val !=0 ) +if (val !=0 ) { +mutex_unlock (&chip->lock);return -EINVAL ; + } ret =isl29018_set_integration_time (chip, val2);break ;case IIO_CHAN_INFO_SCALE :