Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82f703bb8cb2732b4437a9f555a1be564e9e71c2
Commit:     82f703bb8cb2732b4437a9f555a1be564e9e71c2
Parent:     1368c4f2482c9e06bcb297217433818b171cc9e3
Author:     Dmitriy Monakhov <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:24:34 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:14:59 2007 -0700

    freevxfs: possible null pointer dereference fix
    
    sb_read may return NULL, so let's explicitly check it.
    
    Signed-off-by: Dmitriy Monakhov <[EMAIL PROTECTED]>
    Acked-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/freevxfs/vxfs_bmap.c  |    2 +-
 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 2d71128..f86fd3c 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) +
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index 098a915..d1f7c5b 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)
        offset = ((ino % (sbp->s_blocksize / VXFS_ISIZE)) * VXFS_ISIZE);
        bp = sb_bread(sbp, block);
 
-       if (buffer_mapped(bp)) {
+       if (bp && buffer_mapped(bp)) {
                struct vxfs_inode_info  *vip;
                struct vxfs_dinode      *dip;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to