]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
Btrfs: Fix wrong error handling code
authorStefan Behrens <sbehrens@giantdisaster.de>
Thu, 11 Oct 2012 13:25:16 +0000 (07:25 -0600)
committerChris Mason <chris.mason@fusionio.com>
Thu, 25 Oct 2012 19:40:03 +0000 (15:40 -0400)
gcc says "warning: comparison of unsigned expression >= 0 is always
true" because i is an unsigned long. And gcc is right this time.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
fs/btrfs/extent_io.c

index 64dc93f64bc01d624aa85dcf11e6215a6d027611..a32ebfeb91cf509504a126753ac749eb4a95f824 100644 (file)
@@ -4104,8 +4104,8 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len)
 
        return eb;
 err:
-       for (i--; i >= 0; i--)
-               __free_page(eb->pages[i]);
+       for (; i > 0; i--)
+               __free_page(eb->pages[i - 1]);
        __free_extent_buffer(eb);
        return NULL;
 }