diff options
author | KAMBAROV, ZAUR <kambarov@berkeley.edu> | 2005-06-28 20:45:10 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-28 21:20:33 -0700 |
commit | ec471dc484b8ca5352903ee28796b8b248313547 (patch) | |
tree | 8ddb154379fca4913b3fe0930b3e80fc2208edc5 /fs/udf/namei.c | |
parent | 9c101fd439dab60d6eba76afb35fd2696f42c63d (diff) | |
download | linux-3.10-ec471dc484b8ca5352903ee28796b8b248313547.tar.gz linux-3.10-ec471dc484b8ca5352903ee28796b8b248313547.tar.bz2 linux-3.10-ec471dc484b8ca5352903ee28796b8b248313547.zip |
[PATCH] coverity: fs/udf/namei.c null check
"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>
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r-- | fs/udf/namei.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 3f6dc7112bc..4673157b262 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; |