diff options
-rw-r--r-- | drivers/net/b44.c | 7 |
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) | |||
1838 | { | 1838 | { |
1839 | struct mii_ioctl_data *data = if_mii(ifr); | 1839 | struct mii_ioctl_data *data = if_mii(ifr); |
1840 | struct b44 *bp = netdev_priv(dev); | 1840 | struct b44 *bp = netdev_priv(dev); |
1841 | int err; | 1841 | int err = -EINVAL; |
1842 | |||
1843 | if (!netif_running(dev)) | ||
1844 | goto out; | ||
1842 | 1845 | ||
1843 | spin_lock_irq(&bp->lock); | 1846 | spin_lock_irq(&bp->lock); |
1844 | err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL); | 1847 | err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL); |
1845 | spin_unlock_irq(&bp->lock); | 1848 | spin_unlock_irq(&bp->lock); |
1846 | 1849 | out: | |
1847 | return err; | 1850 | return err; |
1848 | } | 1851 | } |
1849 | 1852 | ||