ocfs2: remove unnecessary NULL check in ocfs2_grab_folios()

Smatch complains that checking "folios" for NULL doesn't make sense
because it has already been dereferenced at this point.  Really passing a
NULL "folios" pointer to ocfs2_grab_folios() doesn't make sense, and
fortunately none of the callers do that.  Delete the unnecessary NULL
check.

Link: https://lkml.kernel.org/r/aKRG39hyvDJcN2G7@stanley.mountain
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Mark Tinguely <mark.tinguely@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Dan Carpenter 2025-08-19 12:41:51 +03:00 committed by Andrew Morton
parent f7071db2fe
commit 171c047289
1 changed files with 1 additions and 2 deletions

View File

@ -6928,8 +6928,7 @@ static int ocfs2_grab_folios(struct inode *inode, loff_t start, loff_t end,
out: out:
if (ret != 0) { if (ret != 0) {
if (folios) ocfs2_unlock_and_free_folios(folios, numfolios);
ocfs2_unlock_and_free_folios(folios, numfolios);
numfolios = 0; numfolios = 0;
} }