提交 99603966 编写于 作者: K KAMBAROV, ZAUR 提交者: Linus Torvalds

[PATCH] coverity: udf/balloc.c null deref fix

It's doing

	if (obh)
		<stuff>
	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: NZaur Kambarov <zkambarov@coverity.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 7656f328
...@@ -579,10 +579,9 @@ static void udf_table_free_blocks(struct super_block * sb, ...@@ -579,10 +579,9 @@ static void udf_table_free_blocks(struct super_block * sb,
{ {
loffset = nextoffset; loffset = nextoffset;
aed->lengthAllocDescs = cpu_to_le32(adsize); aed->lengthAllocDescs = cpu_to_le32(adsize);
if (obh) sptr = UDF_I_DATA(inode) + nextoffset -
sptr = UDF_I_DATA(inode) + nextoffset - udf_file_entry_alloc_offset(inode) + UDF_I_LENEATTR(inode) - adsize; udf_file_entry_alloc_offset(inode) +
else UDF_I_LENEATTR(inode) - adsize;
sptr = obh->b_data + nextoffset - adsize;
dptr = nbh->b_data + sizeof(struct allocExtDesc); dptr = nbh->b_data + sizeof(struct allocExtDesc);
memcpy(dptr, sptr, adsize); memcpy(dptr, sptr, adsize);
nextoffset = sizeof(struct allocExtDesc) + adsize; nextoffset = sizeof(struct allocExtDesc) + adsize;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册