From: Xu Wang Date: Mon, 13 Jul 2020 03:33:13 +0000 (+0000) Subject: fsi: fsi-occ: fix return value check in occ_probe() X-Git-Tag: io_uring-5.10-2020-10-20~49^2~172^2~12 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3c3c484850bcb4b28f2377e3d641a32c42af949c;p=linux-block.git 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 Reviewed-by: Guenter Roeck Signed-off-by: Joel Stanley --- diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index 7da9c81759ac..9eeb856c8905 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -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;