Skip to content

Commit

Permalink
net: ifb error path loop fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mariusz Kozlowski authored and Jeff Garzik committed Jan 30, 2007
1 parent 5fc7d61 commit 0c0b3ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ifb.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0c0b3ae

Please sign in to comment.