Skip to contentSkip to conversation

iio: isl29018: Fix uninitialized value

PATCH In review Derek Basehore 2 participants 2 messages Aug 29, 2013 – Sep 8, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: isl29018: Fix uninitialized value

The lux_uscale value is not initialized at probe. The value will be uninitialized unless a value is written to it through the iio channel interface. This fixes that.

Reviewed-on: https://gerrit.chromium.org/gerrit/65998

---
 drivers/staging/iio/light/isl29018.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/light/isl29018.c +1 -0
index 82478a5..28c6386 100644
@@ -564,6 +564,7 @@ static int isl29018_probe(struct i2c_client *client,
 	mutex_init(&chip->lock);
 
 	chip->lux_scale = 1;
+	chip->lux_uscale = 0;
 	chip->range = 1000;
 	chip->adc_bit = 16;
 	chip->suspended = false;
Signature · 1 line
1.8.4
maintainer
#1 lore raw
Quoted 6 lines · Derek Basehore

The lux_uscale value is not initialized at probe. The value will be uninitialized unless a value is written to it through the iio channel interface. This fixes that.

Reviewed-on: https://gerrit.chromium.org/gerrit/65998

Thanks,
Applied to the fixes-togreg branch of iio.git

I'll send this onwards in a few days.

Jonathan

Quoted 17 lines
---
 drivers/staging/iio/light/isl29018.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/light/isl29018.c +1 -0
index 82478a5..28c6386 100644
@@ -564,6 +564,7 @@ static int isl29018_probe(struct i2c_client *client,
 	mutex_init(&chip->lock);
 
 	chip->lux_scale = 1;
+	chip->lux_uscale = 0;
 	chip->range = 1000;
 	chip->adc_bit = 16;
 	chip->suspended = false;