[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240821213312.7ec499c6@jic23-huawei>
Date: Wed, 21 Aug 2024 21:33:12 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Yang Ruibin <11162571@...o.com>
Cc: Nuno Sa <nuno.sa@...log.com>, Olivier Moysan
<olivier.moysan@...s.st.com>, Lars-Peter Clausen <lars@...afoo.de>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
opensource.kernel@...o.com
Subject: Re: [PATCH v1] drivers:iio:Fix the NULL vs IS_ERR() bug for
debugfs_create_dir()
On Wed, 21 Aug 2024 04:39:08 -0400
Yang Ruibin <11162571@...o.com> wrote:
> The debugfs_create_dir() function returns error pointers.
> It never returns NULL. So use IS_ERR() to check it.
>
Applied. Thanks,
Jonathan
> Signed-off-by: Yang Ruibin <11162571@...o.com>
> ---
> drivers/iio/industrialio-backend.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
> index a52a6b61c8b5..20b3b5212da7 100644
> --- a/drivers/iio/industrialio-backend.c
> +++ b/drivers/iio/industrialio-backend.c
> @@ -219,7 +219,7 @@ void iio_backend_debugfs_add(struct iio_backend *back,
> snprintf(name, sizeof(name), "backend%d", back->idx);
>
> back_d = debugfs_create_dir(name, d);
> - if (!back_d)
> + if (IS_ERR(back_d))
> return;
>
> if (back->ops->debugfs_reg_access)
Powered by blists - more mailing lists