From: Jonathan Cameron <jic23@kernel.org>
To: Yang Ruibin <11162571@vivo.com>
Cc: Nuno Sa <nuno.sa@analog.com>,
Olivier Moysan <olivier.moysan@foss.st.com>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
opensource.kernel@vivo.com
Subject: Re: [PATCH v1] drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
Date: Wed, 21 Aug 2024 21:33:12 +0100 [thread overview]
Message-ID: <20240821213312.7ec499c6@jic23-huawei> (raw)
In-Reply-To: <20240821083911.3411-1-11162571@vivo.com>
On Wed, 21 Aug 2024 04:39:08 -0400
Yang Ruibin <11162571@vivo.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@vivo.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)
prev parent reply other threads:[~2024-08-21 20:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 8:39 [PATCH v1] drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir() Yang Ruibin
2024-08-21 20:33 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240821213312.7ec499c6@jic23-huawei \
--to=jic23@kernel.org \
--cc=11162571@vivo.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=opensource.kernel@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox