Re: [PATCH] iio: adc: cpcap: fix incorrect validation

2017-11-19 Thread Jonathan Cameron
On Mon, 13 Nov 2017 10:49:03 -0800 Tony Lindgren wrote: > * Sebastian Reichel [171112 18:30]: > > Hi, > > > > On Mon, Nov 13, 2017 at 12:01:20AM +0800, Pan Bian wrote: > > > Function platform_get_irq_byname() returns a negative error code on > > > failure, and a zero or positive number on suc

Re: [PATCH] iio: adc: cpcap: fix incorrect validation

2017-11-13 Thread Tony Lindgren
* Sebastian Reichel [171112 18:30]: > Hi, > > On Mon, Nov 13, 2017 at 12:01:20AM +0800, Pan Bian wrote: > > 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 a

Re: [PATCH] iio: adc: cpcap: fix incorrect validation

2017-11-12 Thread Sebastian Reichel
Hi, On Mon, Nov 13, 2017 at 12:01:20AM +0800, Pan Bian wrote: > 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->i

[PATCH] iio: adc: cpcap: fix incorrect validation

2017-11-12 Thread Pan Bian
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