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: <20221220004427.1.If5e7ec83b1782e4dffa6ea759416a27326c8231d@changeid>
Date:   Tue, 20 Dec 2022 00:45:01 +0000
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Douglas Anderson <dianders@...omium.org>,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
        Stefan Wahren <stefan.wahren@...e.com>,
        Matthias Kaehlcke <mka@...omium.org>,
        Ravi Chandra Sadineni <ravisadineni@...omium.org>
Subject: [PATCH] usb: misc: onboard_usb_hub: Don't defer probing for 'incomplete' DT nodes

Some boards have device tree nodes for USB hubs supported by the
onboard_usb_hub driver, but the nodes don't have all properties
needed for the driver to work properly (which is not necessarily
an error in the DT). Currently _find_onboard_hub() returns
-EPROBE_DEFER in such cases, which results in an unusable USB hub,
since successive probes fail in the same way. Use the absence of
the "vdd" supply as an indicator of such 'incomplete' DT nodes
and return -ENODEV.

Fixes: 8bc063641ceb ("usb: misc: Add onboard_usb_hub driver")
Reported-by: Stefan Wahren <stefan.wahren@...e.com>
Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
---

 drivers/usb/misc/onboard_usb_hub.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c
index d63c63942af1..2968da515016 100644
--- a/drivers/usb/misc/onboard_usb_hub.c
+++ b/drivers/usb/misc/onboard_usb_hub.c
@@ -363,6 +363,15 @@ static struct onboard_hub *_find_onboard_hub(struct device *dev)
 	hub = dev_get_drvdata(&pdev->dev);
 	put_device(&pdev->dev);
 
+	/*
+	 * Some boards have device tree nodes for USB hubs supported by this
+	 * driver, but the nodes don't have all properties needed for the driver
+	 * to work properly. Use the absence of the "vdd" supply as an indicator
+	 * of such nodes.
+	 */
+	if (!of_get_property(pdev->dev.of_node, "vdd", NULL))
+		return ERR_PTR(-ENODEV);
+
 	/*
 	 * The presence of drvdata ('hub') indicates that the platform driver
 	 * finished probing. This handles the case where (conceivably) we could
-- 
2.39.0.314.g84b9a713c41-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ