Skip to contentSkip to conversation

{10/17} - via-velocity-dont-oops-on-mtu-change-1 - series for stable kernel

2.6.22.y Oliver Pinter (Pintér Olivér) 1 participant 1 message Jan 28, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw
Signature · 2 lines
Thanks,
Oliver

commit cefe0b205bc46195bd3d727c3a64d1315eb348d1

Author: Stephen Hemminger <[email protected]>
Date:   Thu Nov 15 03:47:27 2007 -0800

Subject: [VIA_VELOCITY]: Don't oops on MTU change.
Patch-mainline: v2.6.24-rc3
References: 341537

[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.

drivers/net/via-velocity.c +5 -0
index b670b97..63a2f81 100644
@@ -1798,6 +1798,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);