From: Stephen Hemminger Date: Thu, 15 Nov 2007 03:47:27 +0000 (-0800) Subject: [VIA_VELOCITY]: Don't oops on MTU change. X-Git-Tag: v2.6.24-rc3~5^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd7b3f34198071d8bec05180530c362f1800ba46;p=linux-2.6 [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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 5c4a92de9a..450e29d7a9 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) return -EINVAL; } + if (!netif_running(dev)) { + dev->mtu = new_mtu; + return 0; + } + if (new_mtu != oldmtu) { spin_lock_irqsave(&vptr->lock, flags);