net: ifb error path loop fix
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Sat, 27 Jan 2007 08:00:01 +0000 (00:00 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 30 Jan 2007 14:36:01 +0000 (09:36 -0500)
On error we should start freeing resources at [i-1] not [i-2].

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/ifb.c

index ca2b21f..c4ca7c9 100644 (file)
@@ -271,8 +271,7 @@ static int __init ifb_init_module(void)
        for (i = 0; i < numifbs && !err; i++)
                err = ifb_init_one(i);
        if (err) {
-               i--;
-               while (--i >= 0)
+               while (i--)
                        ifb_free_one(i);
        }