Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: ralink: phy-mt7621-pci: fix return value check in mt7621_pci_phy_probe()

Fix the return value check which testing the wrong variable
in mt7621_pci_phy_probe().

Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210305034931.3237558-1-weiyongjun1@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Wei Yongjun and committed by
Vinod Koul
b976c987 6cb17707

+2 -2
+2 -2
drivers/phy/ralink/phy-mt7621-pci.c
··· 319 319 return PTR_ERR(phy->regmap); 320 320 321 321 phy->phy = devm_phy_create(dev, dev->of_node, &mt7621_pci_phy_ops); 322 - if (IS_ERR(phy)) { 322 + if (IS_ERR(phy->phy)) { 323 323 dev_err(dev, "failed to create phy\n"); 324 - return PTR_ERR(phy); 324 + return PTR_ERR(phy->phy); 325 325 } 326 326 327 327 phy_set_drvdata(phy->phy, phy);