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

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: x86-android-tablets: Fix an IS_ERR() vs NULL check in probe

The spi_new_device() function returns NULL on error, it doesn't return
error pointers.

Fixes: 70505ea6de24 ("platform/x86: x86-android-tablets: Add support for SPI device instantiation")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/4b1b2395-c7c5-44a4-b0b0-6d091c7f46a2@moroto.mountain
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Dan Carpenter and committed by
Hans de Goede
35ddd61c 6e796485

+2 -2
+2 -2
drivers/platform/x86/x86-android-tablets/core.c
··· 220 220 221 221 spi_devs[idx] = spi_new_device(controller, &board_info); 222 222 put_device(&controller->dev); 223 - if (IS_ERR(spi_devs[idx])) 224 - return dev_err_probe(&controller->dev, PTR_ERR(spi_devs[idx]), 223 + if (!spi_devs[idx]) 224 + return dev_err_probe(&controller->dev, -ENOMEM, 225 225 "creating SPI-device %d\n", idx); 226 226 227 227 return 0;