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: <20250723034105.2939635-1-chenyuan0y@gmail.com>
Date: Tue, 22 Jul 2025 22:41:05 -0500
From: Chenyuan Yang <chenyuan0y@...il.com>
To: andrew+netdev@...n.ch,
	davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	richardcochran@...il.com,
	mingo@...nel.org,
	tglx@...utronix.de,
	chenyuan0y@...il.com
Cc: netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] pch_gbe: Add NULL check for ptp_pdev in pch_gbe_probe()

Since pci_get_domain_bus_and_slot() can return NULL for PCI_DEVFN(12, 4),
add NULL check for adapter->ptp_pdev in pch_gbe_probe().

This change is similar to the fix implemented in commit 9af152dcf1a0
("drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data()").

Signed-off-by: Chenyuan Yang <chenyuan0y@...il.com>
---
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index e5a6f59af0b6..10b8f1fea1a2 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2515,6 +2515,11 @@ static int pch_gbe_probe(struct pci_dev *pdev,
 		pci_get_domain_bus_and_slot(pci_domain_nr(adapter->pdev->bus),
 					    adapter->pdev->bus->number,
 					    PCI_DEVFN(12, 4));
+	if (!adapter->ptp_pdev) {
+		dev_err(&pdev->dev, "PTP device not found\n");
+		ret = -ENODEV;
+		goto err_free_netdev;
+	}
 
 	netdev->netdev_ops = &pch_gbe_netdev_ops;
 	netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ