Skip to content

Commit c2cd08e

Browse files
luyunlineswincomputingvinodkoul
authored andcommitted
phy: eswin: Fix incorrect error check in probe()
devm_ioremap() returns NULL on failure, not an ERR_PTR. Using IS_ERR() to check the return value is incorrect. Fix this by checking for NULL and returning -ENOMEM. Fixes: 67ee9cc ("phy: eswin: Create eswin directory and add EIC7700 SATA PHY driver") Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/linux-phy/adjNbuWoc1B-3Ok1@stanley.mountain/ Signed-off-by: Yulin Lu <luyulin@eswincomputing.com> Link: https://patch.msgid.link/20260413070033.128-1-luyulin@eswincomputing.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 8030576 commit c2cd08e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/phy/eswin/phy-eic7700-sata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ static int eic7700_sata_phy_probe(struct platform_device *pdev)
216216
return -ENOENT;
217217

218218
regs = devm_ioremap(dev, res->start, resource_size(res));
219-
if (IS_ERR(regs))
220-
return PTR_ERR(regs);
219+
if (!regs)
220+
return -ENOMEM;
221221

222222
sata_phy->regmap = devm_regmap_init_mmio
223223
(dev, regs, &eic7700_sata_phy_regmap_config);

0 commit comments

Comments
 (0)