From ea47ab111669b187808b3080602788dec26cb9bc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 7 Sep 2021 16:14:05 -0400 Subject: [PATCH] putname(): IS_ERR_OR_NULL() is wrong here Mixing NULL and ERR_PTR() just in case is a Bad Idea(tm). For struct filename the former is wrong - failures are reported as ERR_PTR(...), not as NULL. Signed-off-by: Al Viro --- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index bbb5c9bf5c61..1946d9667790 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -255,7 +255,7 @@ getname_kernel(const char * filename) void putname(struct filename *name) { - if (IS_ERR_OR_NULL(name)) + if (IS_ERR(name)) return; BUG_ON(name->refcnt <= 0); -- 2.20.1