diff options
author | Dmitriy Monakhov <dmonakhov@sw.ru> | 2007-05-08 03:24:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:14:59 -0400 |
commit | 82f703bb8cb2732b4437a9f555a1be564e9e71c2 (patch) | |
tree | 14b96636cc447ff00a5c3da0aa8d114f982b6cea /fs | |
parent | 1368c4f2482c9e06bcb297217433818b171cc9e3 (diff) |
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')
-rw-r--r-- | fs/freevxfs/vxfs_bmap.c | 2 | ||||
-rw-r--r-- | fs/freevxfs/vxfs_inode.c | 2 |
2 files changed, 2 insertions, 2 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) | |||
137 | 137 | ||
138 | bp = sb_bread(ip->i_sb, | 138 | bp = sb_bread(ip->i_sb, |
139 | indir + (i / VXFS_TYPED_PER_BLOCK(ip->i_sb))); | 139 | indir + (i / VXFS_TYPED_PER_BLOCK(ip->i_sb))); |
140 | if (!buffer_mapped(bp)) | 140 | if (!bp || !buffer_mapped(bp)) |
141 | return 0; | 141 | return 0; |
142 | 142 | ||
143 | typ = ((struct vxfs_typed *)bp->b_data) + | 143 | typ = ((struct vxfs_typed *)bp->b_data) + |
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c index 098a915fd9a1..d1f7c5b5b3c3 100644 --- a/fs/freevxfs/vxfs_inode.c +++ b/fs/freevxfs/vxfs_inode.c | |||
@@ -99,7 +99,7 @@ vxfs_blkiget(struct super_block *sbp, u_long extent, ino_t ino) | |||
99 | offset = ((ino % (sbp->s_blocksize / VXFS_ISIZE)) * VXFS_ISIZE); | 99 | offset = ((ino % (sbp->s_blocksize / VXFS_ISIZE)) * VXFS_ISIZE); |
100 | bp = sb_bread(sbp, block); | 100 | bp = sb_bread(sbp, block); |
101 | 101 | ||
102 | if (buffer_mapped(bp)) { | 102 | if (bp && buffer_mapped(bp)) { |
103 | struct vxfs_inode_info *vip; | 103 | struct vxfs_inode_info *vip; |
104 | struct vxfs_dinode *dip; | 104 | struct vxfs_dinode *dip; |
105 | 105 | ||