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: <20260207-phy-apple-resource-err-ptr-v1-1-78735b07ed2d@jannau.net>
Date: Sat, 07 Feb 2026 17:40:34 +0100
From: Janne Grunau <j@...nau.net>
To: Sven Peter <sven@...nel.org>, Neal Gompa <neal@...pa.dev>, 
 Vinod Koul <vkoul@...nel.org>, Neil Armstrong <neil.armstrong@...aro.org>, 
 Philipp Zabel <p.zabel@...gutronix.de>
Cc: asahi@...ts.linux.dev, linux-phy@...ts.infradead.org, 
 linux-kernel@...r.kernel.org, Dan Carpenter <dan.carpenter@...aro.org>, 
 Janne Grunau <j@...nau.net>
Subject: [PATCH phy-next] phy: apple: apple: Check the actual ioremap
 return value

The address where the devm_ioremap_resource() return value is stored is
always a valid pointer. Check the actual return value instead as that
that might be an error value.

Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
Closes: https://lore.kernel.org/asahi/aYXvX1bYOXtYCgfC@stanley.mountain/
Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY")
Signed-off-by: Janne Grunau <j@...nau.net>
---
 drivers/phy/apple/atc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
index dc867f368b68748ea953e594ad998d7f965d8d1d..c144e273a555a741b49adfccbe046df83d193e03 100644
--- a/drivers/phy/apple/atc.c
+++ b/drivers/phy/apple/atc.c
@@ -2206,7 +2206,7 @@ static int atcphy_map_resources(struct platform_device *pdev, struct apple_atcph
 	for (int i = 0; i < ARRAY_SIZE(resources); i++) {
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, resources[i].name);
 		*resources[i].addr = devm_ioremap_resource(&pdev->dev, res);
-		if (IS_ERR(resources[i].addr))
+		if (IS_ERR(*resources[i].addr))
 			return dev_err_probe(atcphy->dev, PTR_ERR(resources[i].addr),
 					     "Unable to map %s regs", resources[i].name);
 

---
base-commit: dbeea86fecef7cf2b93aded4525d74f6277376ef
change-id: 20260207-phy-apple-resource-err-ptr-5923d1130465

Best regards,
-- 
Janne Grunau <j@...nau.net>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ