Commit 3b8bb472 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[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: default avatarStephen Hemminger <>
Signed-off-by: default avatarJeff Garzik <>
parent 2770b517
......@@ -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)) {
err = skge_up(dev);
if (err)
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment