From: Jayachandran C. This patch fixes an errro reported in fs/udf/inode.c by Coverity 2. Error reported: CID: 1510 Checker: REVERSE_INULL (help) File: fs/udf/inode.c Function: inode_bmap Description: Pointer "inode" dereferenced before NULL check Patch description: Move the assignment to bcount to after check for inode == NULL Signed-off-by: Jayachandran C. Signed-off-by: Andrew Morton --- fs/udf/inode.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN fs/udf/inode.c~udf-fix-issues-reported-by-coverity-in-inodec fs/udf/inode.c --- 25/fs/udf/inode.c~udf-fix-issues-reported-by-coverity-in-inodec Tue Oct 18 16:35:13 2005 +++ 25-akpm/fs/udf/inode.c Tue Oct 18 16:35:13 2005 @@ -1954,7 +1954,7 @@ int8_t udf_delete_aext(struct inode *ino int8_t inode_bmap(struct inode *inode, int block, kernel_lb_addr *bloc, uint32_t *extoffset, kernel_lb_addr *eloc, uint32_t *elen, uint32_t *offset, struct buffer_head **bh) { - uint64_t lbcount = 0, bcount = (uint64_t)block << inode->i_sb->s_blocksize_bits; + uint64_t lbcount = 0, bcount; int8_t etype; if (block < 0) @@ -1968,6 +1968,7 @@ int8_t inode_bmap(struct inode *inode, i return -1; } + bcount = (uint64_t)block << inode->i_sb->s_blocksize_bits; *extoffset = 0; *elen = 0; *bloc = UDF_I_LOCATION(inode); _