Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: checking for NULL instead of IS_ERR() in probe

mcb_request_mem() returns an ERR_PTR(), it doesn't return NULL.

Fixes: 74aeac4da66f ('iio: adc: Add MEN 16z188 ADC driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org

authored by

Dan Carpenter and committed by
Jonathan Cameron
e94f62e7 4f3bcd87

+2 -2
+2 -2
drivers/iio/adc/men_z188_adc.c
··· 121 121 indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); 122 122 123 123 mem = mcb_request_mem(dev, "z188-adc"); 124 - if (!mem) 125 - return -ENOMEM; 124 + if (IS_ERR(mem)) 125 + return PTR_ERR(mem); 126 126 127 127 adc->base = ioremap(mem->start, resource_size(mem)); 128 128 if (adc->base == NULL)