diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/pasemi_mac.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index c50f0f4de6d8..abb1dc4592f7 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -404,6 +404,7 @@ static void pasemi_mac_free_csring(struct pasemi_mac_csring *csring) | |||
404 | pasemi_dma_free_flag(csring->events[1]); | 404 | pasemi_dma_free_flag(csring->events[1]); |
405 | pasemi_dma_free_ring(&csring->chan); | 405 | pasemi_dma_free_ring(&csring->chan); |
406 | pasemi_dma_free_chan(&csring->chan); | 406 | pasemi_dma_free_chan(&csring->chan); |
407 | pasemi_dma_free_fun(csring->fun); | ||
407 | } | 408 | } |
408 | 409 | ||
409 | static int pasemi_mac_setup_rx_resources(const struct net_device *dev) | 410 | static int pasemi_mac_setup_rx_resources(const struct net_device *dev) |
@@ -1150,7 +1151,10 @@ static int pasemi_mac_open(struct net_device *dev) | |||
1150 | if (!mac->tx) | 1151 | if (!mac->tx) |
1151 | goto out_tx_ring; | 1152 | goto out_tx_ring; |
1152 | 1153 | ||
1153 | if (dev->mtu > 1500) { | 1154 | /* We might already have allocated rings in case mtu was changed |
1155 | * before interface was brought up. | ||
1156 | */ | ||
1157 | if (dev->mtu > 1500 && !mac->num_cs) { | ||
1154 | pasemi_mac_setup_csrings(mac); | 1158 | pasemi_mac_setup_csrings(mac); |
1155 | if (!mac->num_cs) | 1159 | if (!mac->num_cs) |
1156 | goto out_tx_ring; | 1160 | goto out_tx_ring; |
@@ -1388,8 +1392,12 @@ static int pasemi_mac_close(struct net_device *dev) | |||
1388 | free_irq(mac->tx->chan.irq, mac->tx); | 1392 | free_irq(mac->tx->chan.irq, mac->tx); |
1389 | free_irq(mac->rx->chan.irq, mac->rx); | 1393 | free_irq(mac->rx->chan.irq, mac->rx); |
1390 | 1394 | ||
1391 | for (i = 0; i < mac->num_cs; i++) | 1395 | for (i = 0; i < mac->num_cs; i++) { |
1392 | pasemi_mac_free_csring(mac->cs[i]); | 1396 | pasemi_mac_free_csring(mac->cs[i]); |
1397 | mac->cs[i] = NULL; | ||
1398 | } | ||
1399 | |||
1400 | mac->num_cs = 0; | ||
1393 | 1401 | ||
1394 | /* Free resources */ | 1402 | /* Free resources */ |
1395 | pasemi_mac_free_rx_resources(mac); | 1403 | pasemi_mac_free_rx_resources(mac); |