summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKAMBAROV, ZAUR <kambarov@berkeley.edu>2006-02-03 12:04:49 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 17:32:11 +0100
commit99603966f5b44693901ea68cef2c1c21ce6a49c3 (patch)
tree3d2e45673794c8d5d6a3627ec1843dc14cb994eb /fs
parent[PATCH] debugfs: hard link count wrong (diff)
downloadlinux-99603966f5b44693901ea68cef2c1c21ce6a49c3.tar.xz
linux-99603966f5b44693901ea68cef2c1c21ce6a49c3.zip
[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: Zaur Kambarov <zkambarov@coverity.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/udf/balloc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index 4fae57d9d115..201049ac8a96 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;