[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1194435115-2596-1-git-send-email-ukleinek@informatik.uni-freiburg.de>
Date: Wed, 7 Nov 2007 12:31:55 +0100
From: Uwe Kleine-König
<ukleinek@...ormatik.uni-freiburg.de>
To: netdev@...r.kernel.org
Cc: Uwe Kleine-König <Uwe.Kleine-Koenig@...i.com>,
Andy Fleming <afleming@...escale.com>
Subject: [PATCH] mdiobus_register: check bus not being NULL before dereferencing it.
Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@...i.com>
Cc: Andy Fleming <afleming@...escale.com>
---
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 fc2f0e6..7ff55bb 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;
- spin_lock_init(&bus->mdio_lock);
-
if (NULL == bus || NULL == bus->name ||
NULL == bus->read ||
NULL == bus->write)
return -EINVAL;
+ spin_lock_init(&bus->mdio_lock);
+
if (bus->reset)
bus->reset(bus);
--
1.5.3.4
-
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