]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntfs: prefer IS_ERR_OR_NULL() over manual NULL check
authorHyunchul Lee <hyc.lee@gmail.com>
Wed, 11 Mar 2026 02:13:51 +0000 (11:13 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 16 Mar 2026 11:27:42 +0000 (20:27 +0900)
Use IS_ERR_OR_NULL() instead of manual NULL and IS_ERR() checks.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/dir.c
fs/ntfs/lcnalloc.c

index 8d417b4a0e80a104425f86823ff6a3699f2ed81b..a6fcbde540a7ed6e84071ec5f8a5113fd26ca611 100644 (file)
@@ -593,7 +593,7 @@ err_out:
                unmap_mft_record(dir_ni);
        kfree(name);
        *res = NULL;
-       if (ia_vi && !IS_ERR(ia_vi))
+       if (!IS_ERR_OR_NULL(ia_vi))
                iput(ia_vi);
        return ERR_MREF(err);
 dir_err_out:
index 237f13a11df3c8a654d7890ab1e136596a8279c8..8707189be1c30f4e8e6d95f2173196669047362e 100644 (file)
@@ -721,7 +721,7 @@ out:
                rl[rlpos].lcn = is_extension ? LCN_ENOENT : LCN_RL_NOT_MAPPED;
                rl[rlpos].length = 0;
        }
-       if (likely(folio && !IS_ERR(folio))) {
+       if (!IS_ERR_OR_NULL(folio)) {
                if (need_writeback) {
                        ntfs_debug("Marking page dirty.");
                        folio_mark_dirty(folio);