Commit ba03bda8 authored by Pekka Enberg's avatar Pekka Enberg Committed by Linus Torvalds
Browse files

[PATCH] freevxfs: fix buffer_head leak

- fix a buffer_head leak in vxfs_getfsh()


- check sb_bread() return value

- drop pointless buffer-mapped() test.

Signed-off-by: default avatarPekka Enberg <>
Cc: Christoph Hellwig <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent f220ab2a
......@@ -78,17 +78,18 @@ vxfs_getfsh(struct inode *ip, int which)
struct buffer_head *bp;
bp = vxfs_bread(ip, which);
if (buffer_mapped(bp)) {
if (bp) {
struct vxfs_fsh *fhp;
if (!(fhp = kmalloc(sizeof(*fhp), SLAB_KERNEL)))
return NULL;
if (!(fhp = kmalloc(sizeof(*fhp), GFP_KERNEL)))
goto out;
memcpy(fhp, bp->b_data, sizeof(*fhp));
return (fhp);
return NULL;
Supports Markdown
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