summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2014-01-01 23:04:00 +0000
committerJonathan Cameron <jic23@kernel.org>2014-01-11 11:46:52 +0000
commit38408d056188be29a6c4e17f3703c796551bb330 (patch)
treef3be9dfe10cb57894ad0be6cc00b7bfa26b13357 /drivers/staging/iio
parent66c65d90db1004356281db6ead988e2e38ba9e37 (diff)
staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
Only free an IRQ in error_free_irq, if it has been requested previously. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/adc/ad799x_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
index bad4c8a9d1e9..c1b601acfd90 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -594,7 +594,8 @@ static int ad799x_probe(struct i2c_client *client,
return 0;
error_free_irq:
- free_irq(client->irq, indio_dev);
+ if (client->irq > 0)
+ free_irq(client->irq, indio_dev);
error_cleanup_ring:
ad799x_ring_cleanup(indio_dev);
error_disable_reg: