netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
@ 2009-07-30 21:19 Bartlomiej Zolnierkiewicz
  2009-07-31 18:40 ` Don Fry
  2009-08-02 19:30 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-07-30 21:19 UTC (permalink / raw)
  To: Don Fry; +Cc: netdev, linux-kernel, Dan Carpenter, corbet, eteo, Julia Lawall

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()

Move the debug printk() into the proper place and remove superfluous
NULL pointer check in pcnet32_probe1().

This takes care of the following entry from Dan's list:

drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'

Reported-by: Dan Carpenter <error27@gmail.com>
Cc: corbet@lwn.net
Cc: eteo@redhat.com
Cc: Julia Lawall <julia@diku.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/net/pcnet32.c |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Index: b/drivers/net/pcnet32.c
===================================================================
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1611,8 +1611,11 @@ pcnet32_probe1(unsigned long ioaddr, int
 		if (pcnet32_dwio_read_csr(ioaddr, 0) == 4
 		    && pcnet32_dwio_check(ioaddr)) {
 			a = &pcnet32_dwio;
-		} else
+		} else {
+			if (pcnet32_debug & NETIF_MSG_PROBE)
+				printk(KERN_ERR PFX "No access methods\n");
 			goto err_release_region;
+		}
 	}
 
 	chip_version =
@@ -1853,12 +1856,6 @@ pcnet32_probe1(unsigned long ioaddr, int
 	    ((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
 		lp->options |= PCNET32_PORT_FD;
 
-	if (!a) {
-		if (pcnet32_debug & NETIF_MSG_PROBE)
-			printk(KERN_ERR PFX "No access methods\n");
-		ret = -ENODEV;
-		goto err_free_consistent;
-	}
 	lp->a = *a;
 
 	/* prior to register_netdev, dev->name is not yet correct */
@@ -1974,14 +1971,13 @@ pcnet32_probe1(unsigned long ioaddr, int
 
 	return 0;
 
-      err_free_ring:
+err_free_ring:
 	pcnet32_free_ring(dev);
-      err_free_consistent:
 	pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block),
 			    lp->init_block, lp->init_dma_addr);
-      err_free_netdev:
+err_free_netdev:
 	free_netdev(dev);
-      err_release_region:
+err_release_region:
 	release_region(ioaddr, PCNET32_TOTAL_SIZE);
 	return ret;
 }

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  2009-07-30 21:19 [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1() Bartlomiej Zolnierkiewicz
@ 2009-07-31 18:40 ` Don Fry
  2009-08-02 19:30 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: Don Fry @ 2009-07-31 18:40 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: netdev, linux-kernel, Dan Carpenter, corbet, eteo, Julia Lawall

Acked-by:  Don Fry <pcnet32@verizon.net>

-----Original Message-----
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Don Fry <pcnet32@verizon.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter
<error27@gmail.com>, corbet@lwn.net, eteo@redhat.com, Julia Lawall
<julia@diku.dk>
Subject: [PATCH] pcnet32: remove superfluous NULL pointer check in
pcnet32_probe1()
Date: Thu, 30 Jul 2009 23:19:17 +0200

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()

Move the debug printk() into the proper place and remove superfluous
NULL pointer check in pcnet32_probe1().

This takes care of the following entry from Dan's list:

drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'

Reported-by: Dan Carpenter <error27@gmail.com>
Cc: corbet@lwn.net
Cc: eteo@redhat.com
Cc: Julia Lawall <julia@diku.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/net/pcnet32.c |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Index: b/drivers/net/pcnet32.c
===================================================================
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1611,8 +1611,11 @@ pcnet32_probe1(unsigned long ioaddr, int
 		if (pcnet32_dwio_read_csr(ioaddr, 0) == 4
 		    && pcnet32_dwio_check(ioaddr)) {
 			a = &pcnet32_dwio;
-		} else
+		} else {
+			if (pcnet32_debug & NETIF_MSG_PROBE)
+				printk(KERN_ERR PFX "No access methods\n");
 			goto err_release_region;
+		}
 	}
 
 	chip_version =
@@ -1853,12 +1856,6 @@ pcnet32_probe1(unsigned long ioaddr, int
 	    ((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
 		lp->options |= PCNET32_PORT_FD;
 
-	if (!a) {
-		if (pcnet32_debug & NETIF_MSG_PROBE)
-			printk(KERN_ERR PFX "No access methods\n");
-		ret = -ENODEV;
-		goto err_free_consistent;
-	}
 	lp->a = *a;
 
 	/* prior to register_netdev, dev->name is not yet correct */
@@ -1974,14 +1971,13 @@ pcnet32_probe1(unsigned long ioaddr, int
 
 	return 0;
 
-      err_free_ring:
+err_free_ring:
 	pcnet32_free_ring(dev);
-      err_free_consistent:
 	pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block),
 			    lp->init_block, lp->init_dma_addr);
-      err_free_netdev:
+err_free_netdev:
 	free_netdev(dev);
-      err_release_region:
+err_release_region:
 	release_region(ioaddr, PCNET32_TOTAL_SIZE);
 	return ret;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  2009-07-30 21:19 [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1() Bartlomiej Zolnierkiewicz
  2009-07-31 18:40 ` Don Fry
@ 2009-08-02 19:30 ` David Miller
  2009-08-02 20:07   ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2009-08-02 19:30 UTC (permalink / raw)
  To: bzolnier; +Cc: pcnet32, netdev, linux-kernel, error27, corbet, eteo, julia

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date: Thu, 30 Jul 2009 23:19:17 +0200

> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
> 
> Move the debug printk() into the proper place and remove superfluous
> NULL pointer check in pcnet32_probe1().
> 
> This takes care of the following entry from Dan's list:
> 
> drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'
> 
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Applied, but please CC: netdev@vger.kernel.org for all future
network driver patches so that it gets properly tracked in
patchwork.  Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  2009-08-02 19:30 ` David Miller
@ 2009-08-02 20:07   ` Bartlomiej Zolnierkiewicz
  2009-08-02 20:12     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-08-02 20:07 UTC (permalink / raw)
  To: David Miller; +Cc: pcnet32, netdev, linux-kernel, error27, corbet, eteo, julia

On Sunday 02 August 2009 21:30:22 David Miller wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Date: Thu, 30 Jul 2009 23:19:17 +0200
> 
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
> > 
> > Move the debug printk() into the proper place and remove superfluous
> > NULL pointer check in pcnet32_probe1().
> > 
> > This takes care of the following entry from Dan's list:
> > 
> > drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'
> > 
> > Reported-by: Dan Carpenter <error27@gmail.com>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> 
> Applied, but please CC: netdev@vger.kernel.org for all future
> network driver patches so that it gets properly tracked in
> patchwork.  Thanks!

netdev@vger.kernel.org was on cc: for all patches...

http://marc.info/?l=linux-netdev&m=124898901714229&w=2
http://marc.info/?l=linux-netdev&m=124898901714236&w=2

maybe there is some problem with a patchwork setup..

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  2009-08-02 20:07   ` Bartlomiej Zolnierkiewicz
@ 2009-08-02 20:12     ` David Miller
  2009-08-04 10:32       ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2009-08-02 20:12 UTC (permalink / raw)
  To: bzolnier; +Cc: pcnet32, netdev, linux-kernel, error27, corbet, eteo, julia

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date: Sun, 2 Aug 2009 22:07:29 +0200

> netdev@vger.kernel.org was on cc: for all patches...
> 
> http://marc.info/?l=linux-netdev&m=124898901714229&w=2
> http://marc.info/?l=linux-netdev&m=124898901714236&w=2
> 
> maybe there is some problem with a patchwork setup..

My bad, I misread the CC: list, sorry.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  2009-08-02 20:12     ` David Miller
@ 2009-08-04 10:32       ` Bartlomiej Zolnierkiewicz
  2009-08-04 13:03         ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-08-04 10:32 UTC (permalink / raw)
  To: David Miller; +Cc: pcnet32, netdev, linux-kernel, error27, corbet, eteo, julia

On Sunday 02 August 2009 22:12:56 David Miller wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Date: Sun, 2 Aug 2009 22:07:29 +0200
> 
> > netdev@vger.kernel.org was on cc: for all patches...
> > 
> > http://marc.info/?l=linux-netdev&m=124898901714229&w=2
> > http://marc.info/?l=linux-netdev&m=124898901714236&w=2
> > 
> > maybe there is some problem with a patchwork setup..
> 
> My bad, I misread the CC: list, sorry.

There still may be some netdev patchwork problem..

These patches were applied with Don as an author:

commit 63097b3ad85788a64c75091bff351ecc850761b2
Author: Don Fry <pcnet32@verizon.net>
Date:   Fri Jul 31 08:45:29 2009 +0000

    pcnet32: VLB support fixes

...

commit df4e7f72f5156ef16a918da8a575ba90ec27ab77
Author: Don Fry <pcnet32@verizon.net>
Date:   Fri Jul 31 08:40:06 2009 +0000

    pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()

...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  2009-08-04 10:32       ` Bartlomiej Zolnierkiewicz
@ 2009-08-04 13:03         ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-08-04 13:03 UTC (permalink / raw)
  To: bzolnier; +Cc: pcnet32, netdev, linux-kernel, error27, corbet, eteo, julia

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date: Tue, 4 Aug 2009 12:32:56 +0200

> On Sunday 02 August 2009 22:12:56 David Miller wrote:
>> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>> Date: Sun, 2 Aug 2009 22:07:29 +0200
>> 
>> > netdev@vger.kernel.org was on cc: for all patches...
>> > 
>> > http://marc.info/?l=linux-netdev&m=124898901714229&w=2
>> > http://marc.info/?l=linux-netdev&m=124898901714236&w=2
>> > 
>> > maybe there is some problem with a patchwork setup..
>> 
>> My bad, I misread the CC: list, sorry.
> 
> There still may be some netdev patchwork problem..
> 
> These patches were applied with Don as an author:

It's because he forwarded them to netdev when he ACK'd them, and those
are the ones the postings that actually showed up properly in
patchwork, and thus the From: lines that got used for authorship.

Sorry, I should have caught that.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-08-04 13:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-30 21:19 [PATCH] pcnet32: remove superfluous NULL pointer check in pcnet32_probe1() Bartlomiej Zolnierkiewicz
2009-07-31 18:40 ` Don Fry
2009-08-02 19:30 ` David Miller
2009-08-02 20:07   ` Bartlomiej Zolnierkiewicz
2009-08-02 20:12     ` David Miller
2009-08-04 10:32       ` Bartlomiej Zolnierkiewicz
2009-08-04 13:03         ` David Miller

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).