Skip to content

Commit

Permalink
b44: early return in dev->do_ioctl when the device is not up
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Francois Romieu committed Nov 30, 2005
1 parent d9e2d18 commit 3410572
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3410572

Please sign in to comment.