From: Yang Ruibin <11162571@vivo.com>
To: Nuno Sa <nuno.sa@analog.com>,
Olivier Moysan <olivier.moysan@foss.st.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com, Yang Ruibin <11162571@vivo.com>
Subject: [PATCH v1] drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
Date: Wed, 21 Aug 2024 04:39:08 -0400 [thread overview]
Message-ID: <20240821083911.3411-1-11162571@vivo.com> (raw)
The debugfs_create_dir() function returns error pointers.
It never returns NULL. So use IS_ERR() to check it.
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)
--
2.34.1
next reply other threads:[~2024-08-21 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 8:39 Yang Ruibin [this message]
2024-08-21 20:33 ` [PATCH v1] drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir() Jonathan Cameron
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=20240821083911.3411-1-11162571@vivo.com \
--to=11162571@vivo.com \
--cc=jic23@kernel.org \
--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