Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99603966 authored by KAMBAROV, ZAUR's avatar KAMBAROV, ZAUR Committed by Linus Torvalds
Browse files

[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: 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 7656f328
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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;