Skip to content

Commit 3743a03

Browse files
Alden Tondettarjankara
authored andcommitted
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>
1 parent 585d700 commit 3743a03

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/udf/partition.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
326326
if (!(mdata->s_flags & MF_MIRROR_FE_LOADED)) {
327327
mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb,
328328
mdata->s_mirror_file_loc, map->s_partition_num);
329+
if (IS_ERR(mdata->s_mirror_fe))
330+
mdata->s_mirror_fe = NULL;
329331
mdata->s_flags |= MF_MIRROR_FE_LOADED;
330332
}
331333

0 commit comments

Comments
 (0)