From: KAMBAROV, ZAUR Date: Wed, 29 Jun 2005 03:45:10 +0000 (-0700) Subject: [PATCH] coverity: fs/udf/namei.c null check X-Git-Tag: v2.6.13-rc1~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec471dc484b8ca5352903ee28796b8b248313547;p=linux-2.6 [PATCH] coverity: fs/udf/namei.c null check "dir" was dereferenced before null check Signed-off-by: Zaur Kambarov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 3f6dc7112b..4673157b26 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -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;