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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0810230114180.17076@ds9.feds.ath.cx>
Date:	Thu, 23 Oct 2008 01:24:25 +0200 (CEST)
From:	Sven Hartge <sven@...nhartge.de>
To:	netdev@...r.kernel.org
Subject: [PATCH] via-velocity: earlier name allocation

Hi.

This is my first attempt at a kernel patch ever, so please be gentle :)
(And please CC me, as I am not subscribed to netdev.)

This patch corrects a cosmetic bug in the via-velocity driver which 
bothered me for some time.

The messages printed during device init look like the following:

[    8.486422] eth%d: set value of parameter Wake On Lan options to 0
                  ^^!
[    8.487340] eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter

Note the unresolved format string.

I just copied and adapted the name allocation code from register_netdev 
and call it before the first use of dev->name 

Even if my attempt is incorrect, it should give you an idea what needs 
fixing here.

Signed-off-by: Sven Hartge <sven@...nhartge.de>

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 2dced38..15f2c19 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -934,6 +934,16 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
 	for (i = 0; i < 6; i++)
 		dev->dev_addr[i] = readb(&regs->PAR[i]);
 
+	/*
+	 *  Do name allocation.
+	 */
+
+	if (strchr(dev->name, '%')) {
+		ret = dev_alloc_name(dev, dev->name);
+			if (ret < 0)
+				dev_err(&pdev->dev, "Name allocation failed.\n");
+				goto err_disable;
+	}
 
 	velocity_get_options(&vptr->options, velocity_nics, dev->name);
 


--
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