aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-14 15:47:48 -0800
committerJeff Garzik <jgarzik@pobox.com>2005-12-24 09:36:06 -0500
commit3b8bb472ad8eee6f42bc82647ff5d6d9bfe49e20 (patch)
treea283968f8bee753cbd4be1bdbb3dcd78824c5e48 /drivers/net
parent2770b5172e9b3d135b16d1e5d8344919ac09319d (diff)
[PATCH] skge: handle out of memory on ring parameter change
If changing ring parameters is unable to allocate memory, we need to return an error and take the device down. Fixes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=5715 Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/skge.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 96b661b1f6c..9ff54ea713c 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -397,6 +397,7 @@ static int skge_set_ring_param(struct net_device *dev,
struct ethtool_ringparam *p)
{
struct skge_port *skge = netdev_priv(dev);
+ int err;
if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE)
@@ -407,7 +408,9 @@ static int skge_set_ring_param(struct net_device *dev,
if (netif_running(dev)) {
skge_down(dev);
- skge_up(dev);
+ err = skge_up(dev);
+ if (err)
+ dev_close(dev);
}
return 0;