Commit c2cd08e8 authored by Yulin Lu's avatar Yulin Lu Committed by Vinod Koul
Browse files

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: 67ee9cca ("phy: eswin: Create eswin directory and add EIC7700 SATA PHY driver")
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/linux-phy/adjNbuWoc1B-3Ok1@stanley.mountain/


Signed-off-by: default avatarYulin Lu <luyulin@eswincomputing.com>
Link: https://patch.msgid.link/20260413070033.128-1-luyulin@eswincomputing.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 80305760
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -216,8 +216,8 @@ static int eic7700_sata_phy_probe(struct platform_device *pdev)
		return -ENOENT;

	regs = devm_ioremap(dev, res->start, resource_size(res));
	if (IS_ERR(regs))
		return PTR_ERR(regs);
	if (!regs)
		return -ENOMEM;

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