summaryrefslogtreecommitdiff
path: root/drivers/net/b44.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@electric-eye.fr.zoreil.com>2005-11-30 22:32:13 +0100
committerFrancois Romieu <romieu@electric-eye.fr.zoreil.com>2005-11-30 22:32:13 +0100
commit3410572d519b6c68505f746f25033de97809eaa1 (patch)
tree5767b8a1108ecff31e5cf637eb8cdf5d7f020ae0 /drivers/net/b44.c
parentd9e2d185bf01e20339158f77c3fca00b02014912 (diff)
b44: early return in dev->do_ioctl when the device is not up
The device has not gone through a whole reset/init sequence until the device is up. Accessing the mii interface before this point is not safe. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/b44.c')
-rw-r--r--drivers/net/b44.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index c8d9b4d66704..e0ec777d96df 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -1838,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct mii_ioctl_data *data = if_mii(ifr);
struct b44 *bp = netdev_priv(dev);
- int err;
+ int err = -EINVAL;
+
+ if (!netif_running(dev))
+ goto out;
spin_lock_irq(&bp->lock);
err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
spin_unlock_irq(&bp->lock);
-
+out:
return err;
}