aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2014-01-01 23:04:00 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-22 12:41:27 -0800
commit39779455a6a08341985427784b88a50c6b5cad58 (patch)
treef2560176901944dbbc0fe608f6dd69fbd1b27683
parentdb438cf13a917c449d92c25deba7528fc323a43c (diff)
downloadlinux-39779455a6a08341985427784b88a50c6b5cad58.tar.gz
staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
commit 38408d056188be29a6c4e17f3703c796551bb330 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 8dc97b36e05..b0cb2de9305 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -644,7 +644,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: