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>] [day] [month] [year] [list]
Date:   Tue, 22 Jun 2021 08:57:19 +0000
From:   Zheyu Ma <zheyuma97@...il.com>
To:     mporter@...nel.crashing.org, alex.bou9@...il.com
Cc:     linux-kernel@...r.kernel.org, Zheyu Ma <zheyuma97@...il.com>
Subject: [PATCH] rapidio: tsi721: handle errors properly inside tsi721_probe()

BUG_on() is a too drastic measure, remove them. Instead, just output
error message and exit.

Signed-off-by: Zheyu Ma <zheyuma97@...il.com>
---
 drivers/rapidio/devices/tsi721.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 4dd31dd9feea..92ec5081e5fb 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2851,7 +2851,10 @@ static int tsi721_probe(struct pci_dev *pdev,
 			tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
 	}
 
-	BUG_ON(!pci_is_pcie(pdev));
+	if (!pci_is_pcie(pdev)) {
+		tsi_err(&pdev->dev, "Can't find PCI Express capability");
+		goto err_unmap_bars;
+	}
 
 	/* Clear "no snoop" and "relaxed ordering" bits. */
 	pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL,
-- 
2.17.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ