[patch 13/23] VIA_VELOCITY: Dont oops on MTU change.

Greg KH
2008-02-22T21:49:51Z

[-- Attachment #1: via_velocity-don-t-oops-on-mtu-change.patch --]
[-- Type: text/plain, Size: 939 bytes --]

2.6.22-stable review patch. If anyone has any objections, please let us
know.

------------------

From: Stephen Hemminger <shemminger@linux-foundation.org>

mainline: bd7b3f34198071d8bec05180530c362f1800ba46

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>
Acked-by: Jeff Mahoney <jeffm@suse.com>
CC: Oliver Pinter <oliver.pntr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/net/via-velocity.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -1798,6 +1798,11 @@ static int velocity_change_mtu(struct ne
return -EINVAL;
}

+ if (!netif_running(dev)) {
+ dev->mtu = new_mtu;
+ return 0;
+ }
+
if (new_mtu != oldmtu) {
spin_lock_irqsave(&vptr->lock, flags);

--