]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
fsi: fsi-occ: fix return value check in occ_probe()
authorXu Wang <vulab@iscas.ac.cn>
Mon, 13 Jul 2020 03:33:13 +0000 (03:33 +0000)
committerJoel Stanley <joel@jms.id.au>
Thu, 10 Sep 2020 02:52:47 +0000 (12:22 +0930)
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>
drivers/fsi/fsi-occ.c

index 7da9c81759ac044340084ddda74626468c24dd5a..9eeb856c8905e49c74f07e7212a4804a0eaf019a 100644 (file)
@@ -555,7 +555,7 @@ static int occ_probe(struct platform_device *pdev)
 
        hwmon_dev_info.id = occ->idx;
        hwmon_dev = platform_device_register_full(&hwmon_dev_info);
-       if (!hwmon_dev)
+       if (IS_ERR(hwmon_dev))
                dev_warn(dev, "failed to create hwmon device\n");
 
        return 0;