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: <20151123154648.GA16978@amd>
Date:	Mon, 23 Nov 2015 16:46:48 +0100
From:	Pavel Machek <pavel@....cz>
To:	peppe.cavallaro@...com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc:	trivial@...nel.org
Subject: stmmac: add a warning when aliases are not present in device tree



If aliases are not present in device tree, stmmac_platform.c will
happily assign bus_id of 0 to all the ethernet interfaces, resulting
in hard to debug problems.

At least warn the user about the problem.

Signed-off-by: Pavel Machek <pavel@...x.de>

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index f9b42f1..ee8aa26 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -161,8 +161,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 		plat->max_speed = -1;
 
 	plat->bus_id = of_alias_get_id(np, "ethernet");
-	if (plat->bus_id < 0)
+	if (plat->bus_id < 0) {
+		dev_warn(&pdev->dev, "no aliases for ethernet; multiple ethernets will break\n");
 		plat->bus_id = 0;
+	}
 
 	/* Default to phy auto-detection */
 	plat->phy_addr = -1;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ