mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
phy: Sparx5 Eth SerDes: Fix return value check in sparx5_serdes_probe()
[ Upstream commitb4dc97ab0a
] In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes:2ff8a1eeb5
("phy: Add Sparx5 ethernet serdes PHY driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210909072149.2934047-1-yangyingliang@huawei.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
34f5e44c8f
commit
d0379ee4a8
@ -2475,10 +2475,10 @@ static int sparx5_serdes_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
iomem = devm_ioremap(priv->dev, iores->start, resource_size(iores));
|
||||
if (IS_ERR(iomem)) {
|
||||
if (!iomem) {
|
||||
dev_err(priv->dev, "Unable to get serdes registers: %s\n",
|
||||
iores->name);
|
||||
return PTR_ERR(iomem);
|
||||
return -ENOMEM;
|
||||
}
|
||||
for (idx = 0; idx < ARRAY_SIZE(sparx5_serdes_iomap); idx++) {
|
||||
struct sparx5_serdes_io_resource *iomap = &sparx5_serdes_iomap[idx];
|
||||
|
Loading…
Reference in New Issue
Block a user