public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] fatfs: remove redundant judgment
@ 2022-03-26  3:30 fengyubo
  2022-03-26  4:47 ` OGAWA Hirofumi
  0 siblings, 1 reply; 2+ messages in thread
From: fengyubo @ 2022-03-26  3:30 UTC (permalink / raw)
  To: hirofumi; +Cc: linux-kernel, fengyubo3

From: Yubo Feng <fengyubo3@huawei.com>

iput() has already judged the incoming parameter, so there is no need to
repeat outside.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yubo Feng <fengyubo3@huawei.com>
---
 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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] fatfs: remove redundant judgment
  2022-03-26  3:30 [PATCH -next] fatfs: remove redundant judgment fengyubo
@ 2022-03-26  4:47 ` OGAWA Hirofumi
  0 siblings, 0 replies; 2+ messages in thread
From: OGAWA Hirofumi @ 2022-03-26  4:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, fengyubo

fengyubo <fengyubo3@huawei.com> writes:

> From: Yubo Feng <fengyubo3@huawei.com>
>
> iput() has already judged the incoming parameter, so there is no need to
> repeat outside.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yubo Feng <fengyubo3@huawei.com>

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

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 <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-26  4:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26  3:30 [PATCH -next] fatfs: remove redundant judgment fengyubo
2022-03-26  4:47 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox