diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2014-05-22 19:06:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-23 15:31:49 -0400 |
commit | a92dbd96274ba7615e59bded4f14c2bf9ca46302 (patch) | |
tree | 7fd9a4edfd37983c070fef7ee5875f09e105c98f /drivers/net/ethernet/marvell/mvneta.c | |
parent | 3d4ea02fd87d1222ec43540c983aa387a5fa1a87 (diff) |
net: mvneta: Check tx queue setup error in mvneta_change_mtu()
This commit checks the return code of mvneta_setup_txq() call
in mvneta_change_mtu(). Also, use the netdevice pointer directly
instead of dereferencing the port structure. While here, let's
fix a tiny comment typo.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvneta.c')
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 30346010a64e..d28327d1afd3 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -2425,24 +2425,28 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) | |||
2425 | return 0; | 2425 | return 0; |
2426 | 2426 | ||
2427 | /* The interface is running, so we have to force a | 2427 | /* The interface is running, so we have to force a |
2428 | * reallocation of the RXQs | 2428 | * reallocation of the queues |
2429 | */ | 2429 | */ |
2430 | mvneta_stop_dev(pp); | 2430 | mvneta_stop_dev(pp); |
2431 | 2431 | ||
2432 | mvneta_cleanup_txqs(pp); | 2432 | mvneta_cleanup_txqs(pp); |
2433 | mvneta_cleanup_rxqs(pp); | 2433 | mvneta_cleanup_rxqs(pp); |
2434 | 2434 | ||
2435 | pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu); | 2435 | pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu); |
2436 | pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + | 2436 | pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + |
2437 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); | 2437 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); |
2438 | 2438 | ||
2439 | ret = mvneta_setup_rxqs(pp); | 2439 | ret = mvneta_setup_rxqs(pp); |
2440 | if (ret) { | 2440 | if (ret) { |
2441 | netdev_err(pp->dev, "unable to setup rxqs after MTU change\n"); | 2441 | netdev_err(dev, "unable to setup rxqs after MTU change\n"); |
2442 | return ret; | 2442 | return ret; |
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | mvneta_setup_txqs(pp); | 2445 | ret = mvneta_setup_txqs(pp); |
2446 | if (ret) { | ||
2447 | netdev_err(dev, "unable to setup txqs after MTU change\n"); | ||
2448 | return ret; | ||
2449 | } | ||
2446 | 2450 | ||
2447 | mvneta_start_dev(pp); | 2451 | mvneta_start_dev(pp); |
2448 | mvneta_port_up(pp); | 2452 | mvneta_port_up(pp); |