From: KAMBAROV, ZAUR Date: Fri, 3 Feb 2006 11:04:49 +0000 (-0800) Subject: [PATCH] coverity: udf/balloc.c null deref fix X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=99603966f5b44693901ea68cef2c1c21ce6a49c3;p=mv-sheeva.git [PATCH] coverity: udf/balloc.c null deref fix It's doing if (obh) else dereference obh So presumably `obh' is never null in there. This defect was found automatically by Coverity Prevent, a static analysis tool. Signed-off-by: Zaur Kambarov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index 4fae57d9d11..201049ac8a9 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -579,10 +579,9 @@ static void udf_table_free_blocks(struct super_block * sb, { loffset = nextoffset; aed->lengthAllocDescs = cpu_to_le32(adsize); - if (obh) - sptr = UDF_I_DATA(inode) + nextoffset - udf_file_entry_alloc_offset(inode) + UDF_I_LENEATTR(inode) - adsize; - else - sptr = obh->b_data + nextoffset - adsize; + sptr = UDF_I_DATA(inode) + nextoffset - + udf_file_entry_alloc_offset(inode) + + UDF_I_LENEATTR(inode) - adsize; dptr = nbh->b_data + sizeof(struct allocExtDesc); memcpy(dptr, sptr, adsize); nextoffset = sizeof(struct allocExtDesc) + adsize;