summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorDmitriy Monakhov <dmonakhov@openvz.org>2007-05-08 09:35:22 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 20:15:22 +0200
commit951744fea0aea9adbd7c8cacb3605f2d69a66f96 (patch)
treec46aec13c4a5f3924bc5a73bced68269f275ff2b /fs/udf
parentudf: support files larger than 1G (diff)
downloadlinux-951744fea0aea9adbd7c8cacb3605f2d69a66f96.tar.xz
linux-951744fea0aea9adbd7c8cacb3605f2d69a66f96.zip
udf: possible null pointer dereference while load_partition
sb_read may return NULL, let's explicitly check it. Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org> Cc: Jan Kara <jack@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index a92daaba6c4c..9b8644a06e53 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1403,6 +1403,8 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
pos = udf_block_map(UDF_SB_VAT(sb), 0);
bh = sb_bread(sb, pos);
+ if (!bh)
+ return 1;
UDF_SB_TYPEVIRT(sb,i).s_start_offset =
le16_to_cpu(((struct virtualAllocationTable20 *)bh->b_data + udf_ext0_offset(UDF_SB_VAT(sb)))->lengthHeader) +
udf_ext0_offset(UDF_SB_VAT(sb));