Re: [PATCH 1/2] ntfs: fix NULL dereference in ntfs_index_walk_down()
From: DaeMyung Kang
Date: Sat Apr 25 2026 - 23:49:11 EST
On Sat, Apr 25, 2026, Namjae Jeon wrote:
> Is there any reason why you use IS_ERR_OR_NULL(), not IS_ERR() ?
No good reason -- that was over-defensive on my part. Inside the loop,
entry is only set to one of:
- ie, the caller's argument (both call sites pass a pointer
arithmetic result that cannot be NULL),
- ntfs_ie_get_first(&ictx->ib->index), which is also pointer
arithmetic on ictx->ib that we just checked non-NULL above,
- ERR_PTR(-EIO) on ntfs_ib_read() failure.
So entry is never NULL inside the loop body. I'll switch to plain
IS_ERR() in v2.
Thanks,
DaeMyung