netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] r8169: Fix iteration variable sign
@ 2006-11-29 19:48 Michael Buesch
  2006-11-29 21:21 ` Francois Romieu
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Buesch @ 2006-11-29 19:48 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, Andrew Morton, jgarzik

This changes the type of variable "i" in
rtl8169_init_one() from "unsigned int" to "int".
"i" is checked for <0 later, which can never happen
for "unsigned". This results in broken error handling.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

Index: linux-2.6/drivers/net/r8169.c
===================================================================
--- linux-2.6.orig/drivers/net/r8169.c	2006-11-04 19:03:28.000000000 +0100
+++ linux-2.6/drivers/net/r8169.c	2006-11-29 20:41:59.000000000 +0100
@@ -1473,8 +1473,8 @@ rtl8169_init_one(struct pci_dev *pdev, c
 	struct rtl8169_private *tp;
 	struct net_device *dev;
 	void __iomem *ioaddr;
-	unsigned int i, pm_cap;
-	int rc;
+	unsigned int pm_cap;
+	int i, rc;
 
 	if (netif_msg_drv(&debug)) {
 		printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",

-- 
Greetings Michael.

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

* [PATCH] r8169: Fix iteration variable sign
  2006-11-29 19:48 [PATCH] r8169: Fix iteration variable sign Michael Buesch
@ 2006-11-29 21:21 ` Francois Romieu
  2006-11-30 11:20   ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Francois Romieu @ 2006-11-29 21:21 UTC (permalink / raw)
  To: torvalds; +Cc: Michael Buesch, netdev, Andrew Morton, jgarzik

This changes the type of variable "i" in rtl8169_init_one()
from "unsigned int" to "int". "i" is checked for < 0 later,
which can never happen for "unsigned". This results in broken
error handling.
    
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5002673..c8fa9b1 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1491,8 +1491,8 @@ rtl8169_init_one(struct pci_dev *pdev, c
 	struct rtl8169_private *tp;
 	struct net_device *dev;
 	void __iomem *ioaddr;
-	unsigned int i, pm_cap;
-	int rc;
+	unsigned int pm_cap;
+	int i, rc;
 
 	if (netif_msg_drv(&debug)) {
 		printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",

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

* Re: [PATCH] r8169: Fix iteration variable sign
  2006-11-29 21:21 ` Francois Romieu
@ 2006-11-30 11:20   ` Jeff Garzik
  2006-11-30 14:14     ` Michael Buesch
  2006-11-30 18:56     ` Francois Romieu
  0 siblings, 2 replies; 5+ messages in thread
From: Jeff Garzik @ 2006-11-30 11:20 UTC (permalink / raw)
  To: Francois Romieu; +Cc: torvalds, Michael Buesch, netdev, Andrew Morton

Francois Romieu wrote:
> This changes the type of variable "i" in rtl8169_init_one()
> from "unsigned int" to "int". "i" is checked for < 0 later,
> which can never happen for "unsigned". This results in broken
> error handling.
>     
> Signed-off-by: Michael Buesch <mb@bu3sch.de>
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

ACK but doesn't seem to apply to 2.6.19?

should this go into #upstream rather than #upstream-fixes?



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

* Re: [PATCH] r8169: Fix iteration variable sign
  2006-11-30 11:20   ` Jeff Garzik
@ 2006-11-30 14:14     ` Michael Buesch
  2006-11-30 18:56     ` Francois Romieu
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Buesch @ 2006-11-30 14:14 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Francois Romieu, torvalds, netdev, Andrew Morton

On Thursday 30 November 2006 12:20, Jeff Garzik wrote:
> Francois Romieu wrote:
> > This changes the type of variable "i" in rtl8169_init_one()
> > from "unsigned int" to "int". "i" is checked for < 0 later,
> > which can never happen for "unsigned". This results in broken
> > error handling.
> >     
> > Signed-off-by: Michael Buesch <mb@bu3sch.de>
> > Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> 
> ACK but doesn't seem to apply to 2.6.19?
> 
> should this go into #upstream rather than #upstream-fixes?

Hm, I did this against latest linus' tree.

-- 
Greetings Michael.

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

* Re: [PATCH] r8169: Fix iteration variable sign
  2006-11-30 11:20   ` Jeff Garzik
  2006-11-30 14:14     ` Michael Buesch
@ 2006-11-30 18:56     ` Francois Romieu
  1 sibling, 0 replies; 5+ messages in thread
From: Francois Romieu @ 2006-11-30 18:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: torvalds, Michael Buesch, netdev, Andrew Morton

Jeff Garzik <jgarzik@pobox.com> :
[...]
> should this go into #upstream rather than #upstream-fixes?

It's already in.

The attribution does not follow the ordering of the Signed-off-by
but the S-o-b are fine.

-- 
Ueimor

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

end of thread, other threads:[~2006-11-30 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 19:48 [PATCH] r8169: Fix iteration variable sign Michael Buesch
2006-11-29 21:21 ` Francois Romieu
2006-11-30 11:20   ` Jeff Garzik
2006-11-30 14:14     ` Michael Buesch
2006-11-30 18:56     ` Francois Romieu

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