The d_hash_and_lookup() function returns either an error pointer or NULL. It might be more appropriate to check error using IS_ERR_OR_NULL(). Signed-off-by: Yan Zhen <yanzhen@xxxxxxxx> --- fs/proc/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index f83d41bf155d..e08b36dd4766 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2123,7 +2123,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, ino_t ino = 1; child = d_hash_and_lookup(dir, &qname); - if (!child) { + if (IS_ERR_OR_NULL(child)) { DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); child = d_alloc_parallel(dir, &qname, &wq); if (IS_ERR(child)) -- 2.34.1