From: Markus Elfring Date: Wed, 25 Sep 2019 23:47:24 +0000 (-0700) Subject: fat: delete an unnecessary check before brelse() X-Git-Tag: v5.4-rc1~46^2~45 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=aadc4e01dbaaccd38abde03bc84d0332a6bd9eab;p=linux-block.git fat: delete an unnecessary check before brelse() brelse() tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Link: http://lkml.kernel.org/r/cfff3b81-fb5d-af26-7b5e-724266509045@web.de Signed-off-by: Markus Elfring Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 814ad2c2ba80..054acd9fd033 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c @@ -88,9 +88,7 @@ static int fat__get_entry(struct inode *dir, loff_t *pos, int err, offset; next: - if (*bh) - brelse(*bh); - + brelse(*bh); *bh = NULL; iblock = *pos >> sb->s_blocksize_bits; err = fat_bmap(dir, iblock, &phys, &mapped_blocks, 0, false);