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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed,  6 Feb 2008 10:39:19 +0100
From:	Uwe Kleine-König <>
Cc:	Uwe Kleine-König 
	Andy Fleming <>
Subject: [RESENT PATCH] mdiobus_register: check bus not being NULL before dereferencing it

From: Uwe Kleine-König <>

It doesn't make much sense to check for bus being NULL after using

Signed-off-by: Uwe Kleine-König <>
Cc: Andy Fleming <>

I already sent this patch on November 7, 2007, but without any feedback.

This is rebased to current Linus' master to account for 35b5f6b1.

Best regards

 drivers/net/phy/mdio_bus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 6e9f619..963630c 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -49,13 +49,13 @@ int mdiobus_register(struct mii_bus *bus)
 	int i;
 	int err = 0;
-	mutex_init(&bus->mdio_lock);
 	if (NULL == bus || NULL == bus->name ||
 			NULL == bus->read ||
 			NULL == bus->write)
 		return -EINVAL;
+	mutex_init(&bus->mdio_lock);
 	if (bus->reset)

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists