From: Dan Carpenter Date: Tue, 19 Aug 2025 09:41:51 +0000 (+0300) Subject: ocfs2: remove unnecessary NULL check in ocfs2_grab_folios() X-Git-Tag: v6.18-rc1~129^2~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=171c04728993bac01666994cacaf4d840be97801;p=thirdparty%2Fkernel%2Fstable.git 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 Acked-by: Joseph Qi Reviewed-by: Mark Tinguely Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Signed-off-by: Andrew Morton --- diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 821cb7874685e..162711cc5b201 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -6928,8 +6928,7 @@ static int ocfs2_grab_folios(struct inode *inode, loff_t start, loff_t end, out: if (ret != 0) { - if (folios) - ocfs2_unlock_and_free_folios(folios, numfolios); + ocfs2_unlock_and_free_folios(folios, numfolios); numfolios = 0; }