Commit 0c0b3ae6 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Jeff Garzik

net: ifb error path loop fix

On error we should start freeing resources at [i-1] not [i-2].
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 5fc7d61a
...@@ -271,8 +271,7 @@ static int __init ifb_init_module(void) ...@@ -271,8 +271,7 @@ static int __init ifb_init_module(void)
for (i = 0; i < numifbs && !err; i++) for (i = 0; i < numifbs && !err; i++)
err = ifb_init_one(i); err = ifb_init_one(i);
if (err) { if (err) {
i--; while (i--)
while (--i >= 0)
ifb_free_one(i); ifb_free_one(i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment