]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
phy: ralink: phy-mt7621-pci: fix return value check in mt7621_pci_phy_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Fri, 5 Mar 2021 03:49:31 +0000 (03:49 +0000)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:22 +0000 (17:46 -0600)
BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit b976c987511e34a2e9b23545de912a121a9eded5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/phy/ralink/phy-mt7621-pci.c

index 84ee2b5c222836f14d75f673ad44802dcc55fcbb..753cb5bab9308f71b9ea41cff320f610d42d7995 100644 (file)
@@ -319,9 +319,9 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev)
                return PTR_ERR(phy->regmap);
 
        phy->phy = devm_phy_create(dev, dev->of_node, &mt7621_pci_phy_ops);
-       if (IS_ERR(phy)) {
+       if (IS_ERR(phy->phy)) {
                dev_err(dev, "failed to create phy\n");
-               return PTR_ERR(phy);
+               return PTR_ERR(phy->phy);
        }
 
        phy_set_drvdata(phy->phy, phy);