ext4: release page cache in ext4_mb_load_buddy error path
authorYang Ruirui <ruirui.r.yang@tieto.com>
Sat, 16 Apr 2011 23:17:48 +0000 (19:17 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 16 Apr 2011 23:17:48 +0000 (19:17 -0400)
Add missing page_cache_release in the error path of ext4_mb_load_buddy

Signed-off-by: Yang Ruirui <ruirui.r.yang@tieto.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/mballoc.c

index d8a16eecf1d55748f59c6b66efe8cdf46b589803..15bfa44abd29167010d7e4a6cd53a0c4819b297d 100644 (file)
@@ -1273,6 +1273,8 @@ repeat_load_buddy:
        return 0;
 
 err:
+       if (page)
+               page_cache_release(page);
        if (e4b->bd_bitmap_page)
                page_cache_release(e4b->bd_bitmap_page);
        if (e4b->bd_buddy_page)