diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-11-14 22:47:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-11-14 22:47:27 -0500 |
commit | bd7b3f34198071d8bec05180530c362f1800ba46 (patch) | |
tree | 90895c3efff1c479f7b25c6eba0b3aad1ef145c7 /drivers | |
parent | d06fc1d9b5518582f4982f908e820f2303d1eece (diff) |
[VIA_VELOCITY]: Don't oops on MTU change.
Simple mtu change when device is down.
Fix http://bugzilla.kernel.org/show_bug.cgi?id=9382.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/via-velocity.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 5c4a92de9a07..450e29d7a9f3 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1963,6 +1963,11 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) | |||
1963 | return -EINVAL; | 1963 | return -EINVAL; |
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | if (!netif_running(dev)) { | ||
1967 | dev->mtu = new_mtu; | ||
1968 | return 0; | ||
1969 | } | ||
1970 | |||
1966 | if (new_mtu != oldmtu) { | 1971 | if (new_mtu != oldmtu) { |
1967 | spin_lock_irqsave(&vptr->lock, flags); | 1972 | spin_lock_irqsave(&vptr->lock, flags); |
1968 | 1973 | ||