Re: [PATCH] xfs: Fix error pointer dereference

From: Ethan Tidmore

Date: Thu Feb 19 2026 - 11:47:13 EST


On Thu Feb 19, 2026 at 5:26 AM CST, Nirjhar Roy (IBM) wrote:
> On Wed, 2026-02-18 at 13:51 -0600, Ethan Tidmore wrote:

...

>
> Based on my limited knowledge of this change looks okay to me. I looked into the return values of
> try_lookup_noperm() and it does return error pointer which is not NULL. I also checked the other
> call sites of try_lookup_noperm() but I do see a mixed handling i.e, some places just checks for
> !ptr and some for IS_ERR_OR_NULL. For example in fs/autofs it checks with IS_ERR_OR_NULL whereas in
> fs/proc/base.c it just checks for !child. However, IMO, it is better to check for both NULL and
> error pointer if there is a possibility for both.
> --NR

I was already planning on sending a patch to fs/proc/base.c also. Smatch
was complaining there too.

Thanks,

ET