Commit ec471dc4 authored by KAMBAROV, ZAUR's avatar KAMBAROV, ZAUR Committed by Linus Torvalds

[PATCH] coverity: fs/udf/namei.c null check

"dir" was dereferenced before null check
Signed-off-by: default avatarZaur Kambarov <zkambarov@coverity.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9c101fd4
...@@ -159,7 +159,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry, ...@@ -159,7 +159,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
char *nameptr; char *nameptr;
uint8_t lfi; uint8_t lfi;
uint16_t liu; uint16_t liu;
loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; loff_t size;
kernel_lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset; uint32_t extoffset, elen, offset;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
...@@ -167,6 +167,8 @@ udf_find_entry(struct inode *dir, struct dentry *dentry, ...@@ -167,6 +167,8 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
if (!dir) if (!dir)
return NULL; return NULL;
size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
f_pos = (udf_ext0_offset(dir) >> 2); f_pos = (udf_ext0_offset(dir) >> 2);
fibh->soffset = fibh->eoffset = (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; fibh->soffset = fibh->eoffset = (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment