diff options
author | Dmitriy Monakhov <dmonakhov@sw.ru> | 2007-05-08 09:24:34 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 20:14:59 +0200 |
commit | 82f703bb8cb2732b4437a9f555a1be564e9e71c2 (patch) | |
tree | 14b96636cc447ff00a5c3da0aa8d114f982b6cea /fs/freevxfs/vxfs_bmap.c | |
parent | is_power_of_2 in fs/block_dev.c (diff) | |
download | linux-82f703bb8cb2732b4437a9f555a1be564e9e71c2.tar.xz linux-82f703bb8cb2732b4437a9f555a1be564e9e71c2.zip |
freevxfs: possible null pointer dereference fix
sb_read may return NULL, so let's explicitly check it.
Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/freevxfs/vxfs_bmap.c')
-rw-r--r-- | fs/freevxfs/vxfs_bmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/freevxfs/vxfs_bmap.c b/fs/freevxfs/vxfs_bmap.c index 2d71128bd8d6..f86fd3cacd5a 100644 --- a/fs/freevxfs/vxfs_bmap.c +++ b/fs/freevxfs/vxfs_bmap.c @@ -137,7 +137,7 @@ vxfs_bmap_indir(struct inode *ip, long indir, int size, long block) bp = sb_bread(ip->i_sb, indir + (i / VXFS_TYPED_PER_BLOCK(ip->i_sb))); - if (!buffer_mapped(bp)) + if (!bp || !buffer_mapped(bp)) return 0; typ = ((struct vxfs_typed *)bp->b_data) + |