2022-03-26 07:52:36

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [PATCH -next] fatfs: remove redundant judgment

fengyubo <[email protected]> writes:

> From: Yubo Feng <[email protected]>
>
> iput() has already judged the incoming parameter, so there is no need to
> repeat outside.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Yubo Feng <[email protected]>

Acked-by: OGAWA Hirofumi <[email protected]>

Thanks.

> ---
> fs/fat/inode.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index a6f1c6d426d1..da8619148590 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1888,10 +1888,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
> fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem");
>
> out_fail:
> - if (fsinfo_inode)
> - iput(fsinfo_inode);
> - if (fat_inode)
> - iput(fat_inode);
> + iput(fsinfo_inode);
> + iput(fat_inode);
> unload_nls(sbi->nls_io);
> unload_nls(sbi->nls_disk);
> fat_reset_iocharset(&sbi->options);

--
OGAWA Hirofumi <[email protected]>