Re: [2.6 patch] fs/udf/inode.c: fix a check after use
On Wed, Apr 13, 2005 at 04:17:37AM +0200, Adrian Bunk wrote: > This patch fixes a check after use found by the Coverity checker. Bullshit. *Please*, read the surrounding code. Again, we never get to calling that function if we would pass NULL in its first argument. It's BUG_ON(), not printk(). And oops on entering the function in question is just as good as BUG_ON(). Remove check and be done with that. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[2.6 patch] fs/udf/inode.c: fix a check after use
This patch fixes a check after use found by the Coverity checker. Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> --- This patch was already sent on: - 27 Mar 2005 --- linux-2.6.12-rc1-mm1-full/fs/udf/inode.c.old2005-03-23 05:12:25.0 +0100 +++ linux-2.6.12-rc1-mm1-full/fs/udf/inode.c2005-03-23 05:12:53.0 +0100 @@ -1948,28 +1948,30 @@ udf_release_data(obh); return (elen >> 30); } 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) { printk(KERN_ERR "udf: inode_bmap: block < 0\n"); return -1; } if (!inode) { printk(KERN_ERR "udf: inode_bmap: NULL inode\n"); return -1; } + bcount = (uint64_t)block << inode->i_sb->s_blocksize_bits; + *extoffset = 0; *elen = 0; *bloc = UDF_I_LOCATION(inode); do { if ((etype = udf_next_aext(inode, bloc, extoffset, eloc, elen, bh, 1)) == -1) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[2.6 patch] fs/udf/inode.c: fix a check after use
This patch fixes a check after use found by the Coverity checker. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] --- This patch was already sent on: - 27 Mar 2005 --- linux-2.6.12-rc1-mm1-full/fs/udf/inode.c.old2005-03-23 05:12:25.0 +0100 +++ linux-2.6.12-rc1-mm1-full/fs/udf/inode.c2005-03-23 05:12:53.0 +0100 @@ -1948,28 +1948,30 @@ udf_release_data(obh); return (elen 30); } 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) { printk(KERN_ERR udf: inode_bmap: block 0\n); return -1; } if (!inode) { printk(KERN_ERR udf: inode_bmap: NULL inode\n); return -1; } + bcount = (uint64_t)block inode-i_sb-s_blocksize_bits; + *extoffset = 0; *elen = 0; *bloc = UDF_I_LOCATION(inode); do { if ((etype = udf_next_aext(inode, bloc, extoffset, eloc, elen, bh, 1)) == -1) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [2.6 patch] fs/udf/inode.c: fix a check after use
On Wed, Apr 13, 2005 at 04:17:37AM +0200, Adrian Bunk wrote: This patch fixes a check after use found by the Coverity checker. Bullshit. *Please*, read the surrounding code. Again, we never get to calling that function if we would pass NULL in its first argument. It's BUG_ON(), not printk(). And oops on entering the function in question is just as good as BUG_ON(). Remove check and be done with that. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[2.6 patch] fs/udf/inode.c: fix a check after use
This patch fixes a check after use found by the Coverity checker. Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> --- linux-2.6.12-rc1-mm1-full/fs/udf/inode.c.old2005-03-23 05:12:25.0 +0100 +++ linux-2.6.12-rc1-mm1-full/fs/udf/inode.c2005-03-23 05:12:53.0 +0100 @@ -1948,28 +1948,30 @@ udf_release_data(obh); return (elen >> 30); } 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) { printk(KERN_ERR "udf: inode_bmap: block < 0\n"); return -1; } if (!inode) { printk(KERN_ERR "udf: inode_bmap: NULL inode\n"); return -1; } + bcount = (uint64_t)block << inode->i_sb->s_blocksize_bits; + *extoffset = 0; *elen = 0; *bloc = UDF_I_LOCATION(inode); do { if ((etype = udf_next_aext(inode, bloc, extoffset, eloc, elen, bh, 1)) == -1) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[2.6 patch] fs/udf/inode.c: fix a check after use
This patch fixes a check after use found by the Coverity checker. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] --- linux-2.6.12-rc1-mm1-full/fs/udf/inode.c.old2005-03-23 05:12:25.0 +0100 +++ linux-2.6.12-rc1-mm1-full/fs/udf/inode.c2005-03-23 05:12:53.0 +0100 @@ -1948,28 +1948,30 @@ udf_release_data(obh); return (elen 30); } 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) { printk(KERN_ERR udf: inode_bmap: block 0\n); return -1; } if (!inode) { printk(KERN_ERR udf: inode_bmap: NULL inode\n); return -1; } + bcount = (uint64_t)block inode-i_sb-s_blocksize_bits; + *extoffset = 0; *elen = 0; *bloc = UDF_I_LOCATION(inode); do { if ((etype = udf_next_aext(inode, bloc, extoffset, eloc, elen, bh, 1)) == -1) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/