netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: netdev@oss.sgi.com
Cc: davem@redhat.com, Jeff Garzik <jgarzik@pobox.com>
Subject: [PATCH] Bogus return status in drivers/net/tg3.c
Date: Fri, 19 Dec 2003 23:32:31 +0100	[thread overview]
Message-ID: <20031219233231.A2420@electric-eye.fr.zoreil.com> (raw)

Apply on top of 2.6.0 + Jeff Garzik's 2.6.0-test11-bk5-netdrvr-exp2


The status variable is not set before branching to the error path.


 drivers/net/tg3.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -puN drivers/net/tg3.c~trivial-tg3-fscked-return-status drivers/net/tg3.c
--- linux-2.6.0-vanilla/drivers/net/tg3.c~trivial-tg3-fscked-return-status	2003-12-19 23:21:55.000000000 +0100
+++ linux-2.6.0-vanilla-fr/drivers/net/tg3.c	2003-12-19 23:24:10.000000000 +0100
@@ -7533,13 +7533,16 @@ static int __devinit tg3_init_one(struct
 	if (pm_cap == 0) {
 		printk(KERN_ERR PFX "Cannot find PowerManagement capability, "
 		       "aborting.\n");
+		err = -EIO;
 		goto err_out_free_res;
 	}
 
 	/* Configure DMA attributes. */
-	if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
+	err = pci_set_dma_mask(pdev, 0xffffffffffffffffULL);
+	if (!err) {
 		pci_using_dac = 1;
-		if (pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL)) {
+		err = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL);
+		if (err < 0) {
 			printk(KERN_ERR PFX "Unable to obtain 64 bit DMA "
 			       "for consistent allocations\n");
 			goto err_out_free_res;

_

             reply	other threads:[~2003-12-19 22:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-19 22:32 Francois Romieu [this message]
2003-12-20  0:17 ` [PATCH] Bogus return status in drivers/net/amd8111e.c Francois Romieu
2003-12-20  0:43   ` [PATCH] 2.6.0 - r8169 64 bit Francois Romieu
2003-12-20  1:09     ` Francois Romieu
2003-12-20  5:44 ` [PATCH] Bogus return status in drivers/net/tg3.c David S. Miller
2003-12-20  5:49   ` Jeff Garzik
2003-12-20  5:54     ` David S. Miller

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=20031219233231.A2420@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /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).