]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] coverity: fs/udf/namei.c null check
authorKAMBAROV, ZAUR <kambarov@berkeley.edu>
Wed, 29 Jun 2005 03:45:10 +0000 (20:45 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 29 Jun 2005 04:20:33 +0000 (21:20 -0700)
"dir" was dereferenced before null check

Signed-off-by: Zaur Kambarov <zkambarov@coverity.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/udf/namei.c

index 3f6dc7112bc6c4543bb261d7bf5c12861fc272fc..4673157b262f8d3d16f538a7408b97b5f36383da 100644 (file)
@@ -159,7 +159,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
        char *nameptr;
        uint8_t lfi;
        uint16_t liu;
-       loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
+       loff_t size;
        kernel_lb_addr bloc, eloc;
        uint32_t extoffset, elen, offset;
        struct buffer_head *bh = NULL;
@@ -167,6 +167,8 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
        if (!dir)
                return NULL;
 
+       size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
+
        f_pos = (udf_ext0_offset(dir) >> 2);
 
        fibh->soffset = fibh->eoffset = (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;