[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H6ep_A-7568zE2ggQUXpyhH=zS90TsHP8X0gn5s8LZ8iQ@mail.gmail.com>
Date: Tue, 16 May 2023 10:03:11 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: mirimmad@...look.com
Cc: ivan.orlov0322@...il.com, kernel@...0n.name,
linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
mirimmad17@...il.com, skhan@...uxfoundation.org
Subject: Re: [PATCH v2] loongarch: fix debugfs_create_dir error checking
Queued, thanks.
Huacai
On Sun, May 14, 2023 at 2:44 PM <mirimmad@...look.com> wrote:
>
> From: Immad Mir <mirimmad17@...il.com>
>
> The debugfs_create_dir returns ERR_PTR incase of an error and the
> correct way of checking it by using the IS_ERR_OR_NULL inline function, and
> not the simple null comparision. This patch fixes this.
>
> Suggested-By: Ivan Orlov <ivan.orlov0322@...il.com>
> Signed-off-by: Immad Mir <mirimmad17@...il.com>
> ---
> arch/loongarch/kernel/unaligned.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/kernel/unaligned.c b/arch/loongarch/kernel/unaligned.c
> index bdff825d2..85fae3d2d 100644
> --- a/arch/loongarch/kernel/unaligned.c
> +++ b/arch/loongarch/kernel/unaligned.c
> @@ -485,7 +485,7 @@ static int __init debugfs_unaligned(void)
> struct dentry *d;
>
> d = debugfs_create_dir("loongarch", NULL);
> - if (!d)
> + if (IS_ERR_OR_NULL(d))
> return -ENOMEM;
>
> debugfs_create_u32("unaligned_instructions_user",
> --
> 2.40.0
>
Powered by blists - more mailing lists