]> git.neil.brown.name Git - LaFS.git/commitdiff
lafs_get_block: fix mem leak on error path.
authorNeilBrown <neilb@suse.de>
Wed, 28 Jul 2010 11:15:44 +0000 (21:15 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 9 Aug 2010 01:58:12 +0000 (11:58 +1000)
forget to put the page...

Signed-off-by: NeilBrown <neilb@suse.de>
block.c

diff --git a/block.c b/block.c
index b756e0a4c851dbca09cdb34719b9ac155d88eb73..107048d96eed6b5f8e8a553c8924650d6e28bb6e 100644 (file)
--- a/block.c
+++ b/block.c
@@ -120,9 +120,10 @@ lafs_get_block(struct inode *ino, unsigned long index, struct page *p,
                dprintk("setting up %p for %lu\n", p, index);
                b = kzalloc(sizeof(struct datablock)<<bits, gfp);
                if (!b) {
-                       if (unlock)
+                       if (unlock) {
                                unlock_page(p);
-                       page_cache_release(p);
+                               page_cache_release(p);
+                       }
                        return NULL;
                }