Commit 3410572d authored by Francois Romieu's avatar Francois Romieu

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: default avatarFrancois Romieu <romieu@fr.zoreil.com>
parent d9e2d185
...@@ -1838,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -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 mii_ioctl_data *data = if_mii(ifr);
struct b44 *bp = netdev_priv(dev); struct b44 *bp = netdev_priv(dev);
int err; int err = -EINVAL;
if (!netif_running(dev))
goto out;
spin_lock_irq(&bp->lock); spin_lock_irq(&bp->lock);
err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL); err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
spin_unlock_irq(&bp->lock); spin_unlock_irq(&bp->lock);
out:
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment