iio: dac: ad5504: Don't set error code to voltage_uv
Subsystems (2)
PATCH v2 3/6 iio: dac: ad5504: Don't set error code to voltage_uv
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.
---
v2: check if ret is negative value
drivers/iio/dac/ad5504.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5504.c +5 -1
@@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)if (ret) goto error_put_reg; - voltage_uv =regulator_get_voltage (reg); + ret =regulator_get_voltage (reg); +if (ret <0 ) + goto error_disable_reg; + + voltage_uv = ret; }spi_set_drvdata (spi, indio_dev);
Signature · 1 line
1.7.9.5
PATCH v2 4/6 iio: dac: ad5624r_spi: Don't set error code to voltage_uv
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.
---
v2: check if ret is negative value
drivers/iio/dac/ad5624r_spi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5624r_spi.c +5 -1
@@ -238,7 +238,11 @@ static int __devinit ad5624r_probe(struct spi_device *spi)if (ret) goto error_put_reg; - voltage_uv =regulator_get_voltage (st->reg); + ret =regulator_get_voltage (st->reg); +if (ret <0 ) + goto error_disable_reg; + + voltage_uv = ret; }spi_set_drvdata (spi, indio_dev);
Signature · 1 line
1.7.9.5
PATCH v2 5/6 iio: dac: ad5686: Don't set error code to voltage_uv
In reply to Axel Linregulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.
---
v2: check if ret is negative value
drivers/iio/dac/ad5686.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5686.c +5 -1
@@ -332,7 +332,11 @@ static int __devinit ad5686_probe(struct spi_device *spi)if (ret) goto error_put_reg; - voltage_uv =regulator_get_voltage (st->reg); + ret =regulator_get_voltage (st->reg); +if (ret <0 ) + goto error_disable_reg; + + voltage_uv = ret; } st->chip_info =
Signature · 1 line
1.7.9.5
Jonathan Cameron
maintainerQuoted 4 lines · Axel Lin
regulator_get_voltage()may return negative error code. Add error checking to avoid setting error code tovoltage_uv.Signed-off-by Axel Lin <[email protected]>
Axel,
I would definitely have prefered a resend of the whole series rather than just the ones you have fixed up.
I assumed Lars would have no objection to Acking these as well!
Anyhow 1,2,6 from v1 and 3,4,5 from v2 added to fixes-togreg branch of iio.git.
Thanks for all these!
Jonathan
Quoted 23 lines
---
v2: check if ret is negative valuedrivers/iio/dac/ad5504.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/iio/dac/ad5504.c +5
-1@@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)if (ret) goto error_put_reg; - voltage_uv =regulator_get_voltage (reg); + ret =regulator_get_voltage (reg); +if (ret <0 ) + goto error_disable_reg; + + voltage_uv = ret; }spi_set_drvdata (spi, indio_dev);