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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221222022605.v2.2.I0c5ce35d591fa1f405f213c444522585be5601f0@changeid>
Date:   Thu, 22 Dec 2022 02:26:45 +0000
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
        Stefan Wahren <stefan.wahren@...e.com>, stable@...r.kernel.org,
        Douglas Anderson <dianders@...omium.org>,
        Matthias Kaehlcke <mka@...omium.org>,
        Ravi Chandra Sadineni <ravisadineni@...omium.org>
Subject: [PATCH v2 2/2] usb: misc: onboard_hub: Fail silently when there is no platform device

Some boards with an onboard USB hub supported by the onboard_hub
driver have a device tree node for the hub, but the node doesn't
specify all properties needed by the driver (which is not a DT
error per se). For such a hub no onboard_hub platform device is
created. However the USB portion of the onboard hub driver still
probes and uses _find_onboard_hub() to find the platform device
that corresponds to the hub. If the DT node of the hub doesn't
have an associated platform device the function looks for a
"peer-hub" node (to get the platform device from there), if
that doesn't exist either it logs an error and returns -EINVAL.

The absence of a platform device is expected in some
configurations, so drop the error log and fail silently with
-ENODEV.

Fixes: 8bc063641ceb ("usb: misc: Add onboard_usb_hub driver")
Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
---

Changes in v2:
- patch added to the series

 drivers/usb/misc/onboard_usb_hub.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c
index d63c63942af1..44a0b0ddee55 100644
--- a/drivers/usb/misc/onboard_usb_hub.c
+++ b/drivers/usb/misc/onboard_usb_hub.c
@@ -348,10 +348,8 @@ static struct onboard_hub *_find_onboard_hub(struct device *dev)
 	pdev = of_find_device_by_node(dev->of_node);
 	if (!pdev) {
 		np = of_parse_phandle(dev->of_node, "peer-hub", 0);
-		if (!np) {
-			dev_err(dev, "failed to find device node for peer hub\n");
-			return ERR_PTR(-EINVAL);
-		}
+		if (!np)
+			return ERR_PTR(-ENODEV);
 
 		pdev = of_find_device_by_node(np);
 		of_node_put(np);
-- 
2.39.0.314.g84b9a713c41-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ