Skip to contentSkip to conversation

iio: Fix inkern remove incorrect put of device

PATCH Applied Jonathan Cameron 1 participant 2 messages Jun 30, 2012 – Jul 8, 2012 IIO

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio: Fix inkern remove incorrect put of device

The device_get is after this point so on error we should not be removing it.

---
 drivers/iio/inkern.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/inkern.c +0 -1
index 9a46ca6..e2aded0 100644
@@ -193,7 +193,6 @@ struct iio_channel *iio_channel_get_all(const char *name)
 						c->map->adc_channel_label);
 		if (chans[mapind].channel == NULL) {
 			ret = -EINVAL;
-			iio_device_put(chans[mapind].indio_dev);
 			goto error_free_chans;
 		}
 		iio_device_get(chans[mapind].indio_dev);
Signature · 1 line
1.7.11.1
author maintainer Applied
#1 lore raw
Quoted 3 lines · Jonathan Cameron

The device_get is after this point so on error we should not be removing it.

merged to fixes.

Quoted 18 lines
---
 drivers/iio/inkern.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/inkern.c +0 -1
index 9a46ca6..e2aded0 100644
@@ -193,7 +193,6 @@ struct iio_channel *iio_channel_get_all(const char *name)
 						c->map->adc_channel_label);
 		if (chans[mapind].channel == NULL) {
 			ret = -EINVAL;
-			iio_device_put(chans[mapind].indio_dev);
 			goto error_free_chans;
 		}
 		iio_device_get(chans[mapind].indio_dev);