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

fsi: fsi-occ: fix return value check in occ_probe()

In case of error, the function platform_device_register_full()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check should be replaced with IS_ERR().

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Joel Stanley <joel@jms.id.au>

authored by

Xu Wang and committed by
Joel Stanley
3c3c4848 6e0ef7d2

+1 -1
+1 -1
drivers/fsi/fsi-occ.c
··· 555 555 556 556 hwmon_dev_info.id = occ->idx; 557 557 hwmon_dev = platform_device_register_full(&hwmon_dev_info); 558 - if (!hwmon_dev) 558 + if (IS_ERR(hwmon_dev)) 559 559 dev_warn(dev, "failed to create hwmon device\n"); 560 560 561 561 return 0;