mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
udf: possible null pointer dereference while load_partition
sb_read may return NULL, let's explicitly check it. Signed-off-by: Dmitriy Monakhov <[email protected]> Cc: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
31170b6ad4
commit
951744fea0
1 changed files with 2 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue