From: Francois Romieu Date: Wed, 29 Nov 2006 21:21:33 +0000 (+0100) Subject: [PATCH] r8169: Fix iteration variable sign X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=315917d23fdd20a0f4ff99b9228de5840d9d276c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] r8169: Fix iteration variable sign 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 Signed-off-by: Francois Romieu Signed-off-by: Linus Torvalds --- diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 27f90b2139c0..b977ed85ff39 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -1473,8 +1473,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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",