lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220201215941.1203155-1-huobean@gmail.com>
Date:   Tue,  1 Feb 2022 22:59:41 +0100
From:   Bean Huo <huobean@...il.com>
To:     songxiaowei@...ilicon.com, wangbinghui@...ilicon.com,
        lorenzo.pieralisi@....com, robh@...nel.org, kw@...ux.com,
        bhelgaas@...gle.com, ffclaire1224@...il.com,
        linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     beanhuo@...ron.com
Subject: [PATCH] PCI: kirin: Fix kirin960-pcie probe failure issue

From: Bean Huo <beanhuo@...ron.com>

of_device_get_match_data() will return 'enum pcie_kirin_phy_type' type
value, and most likely the return value will be PCIE_KIRIN_INTERNAL_PHY == 0.
This will cause the PCI probe to fail. And of_device_get_match_data() does not
require error checking on its return on devicetree based platform.

So,this patch is to remove unnecessary error checking to fix kirin960-pcie
probe failure issue.

Fixes: a622435fbe1a ("PCI: kirin: Prefer of_device_get_match_data()")
Signed-off-by: Bean Huo <beanhuo@...ron.com>
---
 drivers/pci/controller/dwc/pcie-kirin.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
index fa6886d66488..e102aa6efb7f 100644
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -781,12 +781,7 @@ static int kirin_pcie_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	phy_type = (long)of_device_get_match_data(dev);
-	if (!phy_type) {
-		dev_err(dev, "OF data missing\n");
-		return -EINVAL;
-	}
-
+	phy_type = (enum pcie_kirin_phy_type)of_device_get_match_data(dev);
 
 	kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
 	if (!kirin_pcie)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ