diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-04 00:27:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-04 00:27:42 -0500 |
commit | 0a0e9ae1bd788bc19adc4d4ae08c98b233697402 (patch) | |
tree | 13825eeb5bbeae27d66e95f12168eff4b60701ab /drivers/net/sfc | |
parent | 01a16b21d6adf992aa863186c3c4e561a57c1714 (diff) | |
parent | b65a0e0c84cf489bfa00d6aa6c48abc5a237100f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bnx2x/bnx2x.h
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 158d5b5630b6..807178ef65ad 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -588,9 +588,14 @@ static void efx_ethtool_self_test(struct net_device *net_dev, | |||
588 | struct ethtool_test *test, u64 *data) | 588 | struct ethtool_test *test, u64 *data) |
589 | { | 589 | { |
590 | struct efx_nic *efx = netdev_priv(net_dev); | 590 | struct efx_nic *efx = netdev_priv(net_dev); |
591 | struct efx_self_tests efx_tests; | 591 | struct efx_self_tests *efx_tests; |
592 | int already_up; | 592 | int already_up; |
593 | int rc; | 593 | int rc = -ENOMEM; |
594 | |||
595 | efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL); | ||
596 | if (!efx_tests) | ||
597 | goto fail; | ||
598 | |||
594 | 599 | ||
595 | ASSERT_RTNL(); | 600 | ASSERT_RTNL(); |
596 | if (efx->state != STATE_RUNNING) { | 601 | if (efx->state != STATE_RUNNING) { |
@@ -608,13 +613,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev, | |||
608 | if (rc) { | 613 | if (rc) { |
609 | netif_err(efx, drv, efx->net_dev, | 614 | netif_err(efx, drv, efx->net_dev, |
610 | "failed opening device.\n"); | 615 | "failed opening device.\n"); |
611 | goto fail2; | 616 | goto fail1; |
612 | } | 617 | } |
613 | } | 618 | } |
614 | 619 | ||
615 | memset(&efx_tests, 0, sizeof(efx_tests)); | 620 | rc = efx_selftest(efx, efx_tests, test->flags); |
616 | |||
617 | rc = efx_selftest(efx, &efx_tests, test->flags); | ||
618 | 621 | ||
619 | if (!already_up) | 622 | if (!already_up) |
620 | dev_close(efx->net_dev); | 623 | dev_close(efx->net_dev); |
@@ -623,10 +626,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev, | |||
623 | rc == 0 ? "passed" : "failed", | 626 | rc == 0 ? "passed" : "failed", |
624 | (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); | 627 | (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); |
625 | 628 | ||
626 | fail2: | 629 | fail1: |
627 | fail1: | ||
628 | /* Fill ethtool results structures */ | 630 | /* Fill ethtool results structures */ |
629 | efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data); | 631 | efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data); |
632 | kfree(efx_tests); | ||
633 | fail: | ||
630 | if (rc) | 634 | if (rc) |
631 | test->flags |= ETH_TEST_FL_FAILED; | 635 | test->flags |= ETH_TEST_FL_FAILED; |
632 | } | 636 | } |