netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
To: davem@davemleft.org, dnelson@redhat.com
Cc: Dean Nelson <dnelson@redhat.com>,
	netdev@vger.kernel.org, gospo@redhat.com, bphilips@novell.com,
	stable@kernel.org, Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next-2.6 08/27] e1000: fix return value not set on error
Date: Fri, 10 Dec 2010 01:50:48 -0800	[thread overview]
Message-ID: <1291974667-30254-9-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1291974667-30254-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Dean Nelson <dnelson@redhat.com>

Dean noticed that 'err' wasn't being set when the "goto err_dma"
statement is executed in the following hunk from the commit. It's value
will be zero as a result of a successful call to e1000_init_hw_struct().

This patch changes the error condition to be correctly propagated.

CC: stable@kernel.org
Signed-off-by:  Dean Nelson <dnelson@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000/e1000_main.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 06c7d1c..491bf2a 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -971,11 +971,13 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 		 */
 		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
 		pci_using_dac = 1;
-	} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
-		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
 	} else {
-		pr_err("No usable DMA config, aborting\n");
-		goto err_dma;
+		err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+		if (err) {
+			pr_err("No usable DMA config, aborting\n");
+			goto err_dma;
+		}
+		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
 	}
 
 	netdev->netdev_ops = &e1000_netdev_ops;
-- 
1.7.3.2


  parent reply	other threads:[~2010-12-10  9:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10  9:50 [net-next 00/27][pull-request] Intel Wired LAN Driver Updates Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 01/27] Documentation/networking/e1000.txt: Update documentation Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 02/27] Documentation/networking/e1000e.txt: " Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 03/27] Documentation/networking/igb.txt: update documentation Jeff Kirsher
2010-12-10 15:50   ` Ben Hutchings
2010-12-10 20:21     ` David Miller
2010-12-11  5:26       ` Jeff Kirsher
2010-12-11  5:25     ` Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 04/27] Documentation/networking/igbvf.txt: Update documentation Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 05/27] Documentation/networking/ixgbe.txt: Update ixgbe documentation Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 06/27] Documentation/networking/ixgbevf.txt: Update documentation Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 07/27] MAINTAINERS: Update Intel Wired LAN info Jeff Kirsher
2010-12-10  9:50 ` Jeff Kirsher [this message]
2010-12-10  9:50 ` [net-next-2.6 08/27] e1000: fix return value not set on error Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 09/27] Intel Wired LAN drivers: Use static const Jeff Kirsher
2010-12-10  9:50 ` [net-next-2.6 10/27] ixgb: Don't check for vlan group on transmit Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291974667-30254-9-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=bphilips@novell.com \
    --cc=davem@davemloft.net \
    --cc=dnelson@redhat.com \
    --cc=gospo@redhat.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).