From: Lars-Peter Clausen Date: Mon, 4 Jun 2012 09:36:25 +0000 (+0200) Subject: staging:iio:dac:ad5504: Check if IRQ was requested before freeing it X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4f0a788dc892d62fabcfd61b289b6212bdedadfd;p=openwrt%2Fstaging%2Fblogic.git staging:iio:dac:ad5504: Check if IRQ was requested before freeing it 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 Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c index 220150d2a165..f3d7b47cfe1d 100644 --- a/drivers/staging/iio/dac/ad5504.c +++ b/drivers/staging/iio/dac/ad5504.c @@ -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);