Browse Source

[XFS] Fix double free in xfs_buf_get_noaddr error handling path

SGI-PV: 964983
SGI-Modid: xfs-linux-melb:xfs-kern:28639a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Christoph Hellwig 18 years ago
parent
commit
ca165b8892
1 changed files with 2 additions and 1 deletions
  1. 2 1
      fs/xfs/linux-2.6/xfs_buf.c

+ 2 - 1
fs/xfs/linux-2.6/xfs_buf.c

@@ -792,8 +792,9 @@ xfs_buf_get_noaddr(
  fail_free_mem:
  fail_free_mem:
 	while (--i >= 0)
 	while (--i >= 0)
 		__free_page(bp->b_pages[i]);
 		__free_page(bp->b_pages[i]);
+	_xfs_buf_free_pages(bp);
  fail_free_buf:
  fail_free_buf:
-	xfs_buf_free(bp);
+	xfs_buf_deallocate(bp);
  fail:
  fail:
 	return NULL;
 	return NULL;
 }
 }