patch "iio: adc: cpcap: fix incorrect validation" added to staging-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
iio: adc: cpcap: fix incorrect validation
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
81b039ec36a41a5451e1e36f05bb055eceab1dc8Mon Sep 17 00:00:00 2001
From: Pan Bian <[email protected]>
Date: Mon, 13 Nov 2017 00:01:20 +0800
Subject: iio: adc: cpcap: fix incorrect validation
Function platform_get_irq_byname() returns a negative error code on failure, and a zero or positive number on success. However, in function cpcap_adc_probe(), positive IRQ numbers are also taken as error cases. Use "if (ddata->irq < 0)" instead of "if (!ddata->irq)" to validate the return value of platform_get_irq_byname().
--- drivers/iio/adc/cpcap-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/cpcap-adc.c +1 -1
@@ -1011,7 +1011,7 @@ static int cpcap_adc_probe(struct platform_device *pdev)platform_set_drvdata (pdev, indio_dev); ddata->irq =platform_get_irq_byname (pdev,"adcdone" ); -if (!ddata->irq) +if (ddata->irq <0 )return -ENODEV ; error = devm_request_threaded_irq(&pdev->dev, ddata->irq, NULL,
Signature · 1 line
2.15.1