net: pcs-rzn1-miic: fix return value check in miic_probe()

On failure, devm_platform_ioremap_resource() returns a ERR_PTR() value
and not NULL. Fix return value checking by using IS_ERR() and return
PTR_ERR() as error value.

Fixes: 7dc54d3b8d ("net: pcs: add Renesas MII converter driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Clément Léger <clement.leger@bootlin.com>
Link: https://lore.kernel.org/r/20220628131259.3109124-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Yang Yingliang 2022-06-28 21:12:59 +08:00 committed by Jakub Kicinski
parent 626af58bad
commit dbc6fc7e3f
1 changed files with 2 additions and 2 deletions

View File

@ -461,8 +461,8 @@ static int miic_probe(struct platform_device *pdev)
spin_lock_init(&miic->lock);
miic->dev = dev;
miic->base = devm_platform_ioremap_resource(pdev, 0);
if (!miic->base)
return -EINVAL;
if (IS_ERR(miic->base))
return PTR_ERR(miic->base);
ret = devm_pm_runtime_enable(dev);
if (ret < 0)