Skip to content

Commit

Permalink
staging:iio:dac:ad5504: Check if IRQ was requested before freeing it
Browse files Browse the repository at this point in the history
IRQ support is optional, so we have to check whether it was actually requested
before we attempt to free it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent 4468cb5 commit 4f0a788
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/iio/dac/ad5504.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ static int __devinit ad5504_probe(struct spi_device *spi)
return 0;

error_free_irq:
free_irq(spi->irq, indio_dev);
if (spi->irq)
free_irq(spi->irq, indio_dev);
error_disable_reg:
if (!IS_ERR(reg))
regulator_disable(reg);
Expand Down

0 comments on commit 4f0a788

Please sign in to comment.