diff options
author | Alden Tondettar <alden.tondettar@gmail.com> | 2016-05-18 17:09:18 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2016-05-19 06:00:03 -0400 |
commit | 3743a03e72b73b6234768bce06d7bf5a57c47285 (patch) | |
tree | 4882cd86fe1518597de563adbdf76236b484072c /fs | |
parent | 585d70006f6e30f42e96d56c6c0933671c516c7b (diff) |
udf: Use IS_ERR when loading metadata mirror file entry
Currently when udf_get_pblock_meta25() fails to map a block using the
primary metadata file, it will attempt to load the mirror file entry by
calling udf_find_metadata_inode_efe(). That function will return a ERR_PTR
if it fails, but the return value is only checked against NULL. Test the
return value using IS_ERR() and change it to NULL if needed.
Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/udf/partition.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/udf/partition.c b/fs/udf/partition.c index e4e9e70c37f2..ca3cde336324 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c | |||
@@ -326,6 +326,8 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block, | |||
326 | if (!(mdata->s_flags & MF_MIRROR_FE_LOADED)) { | 326 | if (!(mdata->s_flags & MF_MIRROR_FE_LOADED)) { |
327 | mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb, | 327 | mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb, |
328 | mdata->s_mirror_file_loc, map->s_partition_num); | 328 | mdata->s_mirror_file_loc, map->s_partition_num); |
329 | if (IS_ERR(mdata->s_mirror_fe)) | ||
330 | mdata->s_mirror_fe = NULL; | ||
329 | mdata->s_flags |= MF_MIRROR_FE_LOADED; | 331 | mdata->s_flags |= MF_MIRROR_FE_LOADED; |
330 | } | 332 | } |
331 | 333 | ||