Skip to content

Commit a83695a

Browse files
marcusfolkessonjic23
authored andcommitted
iio: adc: mcp3911: return proper error code on failure to allocate trigger
smatch warnings: drivers/iio/adc/mcp3911.c:441 mcp3911_probe() warn: passing zero to 'PTR_ERR' Fixes: 08a65f6 ("iio: adc: mcp3911: add support for interrupts") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Marcus Folkesson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 7578847 commit a83695a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/mcp3911.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ static int mcp3911_probe(struct spi_device *spi)
496496
indio_dev->name,
497497
iio_device_id(indio_dev));
498498
if (!adc->trig)
499-
return PTR_ERR(adc->trig);
499+
return -ENOMEM;
500500

501501
adc->trig->ops = &mcp3911_trigger_ops;
502502
iio_trigger_set_drvdata(adc->trig, adc);

0 commit comments

Comments
 (0)