From: Yeqi Fu <asuk4.q@gmail.com>
To: dinguyen@kernel.org, bp@alien8.de, tony.luck@intel.com
Cc: Yeqi Fu <asuk4.q@gmail.com>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] EDAC/altera: Fix error checking
Date: Thu, 18 May 2023 03:15:56 +0800 [thread overview]
Message-ID: <20230517191556.367689-1-asuk4.q@gmail.com> (raw)
The function edac_debugfs_create_dir returns ERR_PTR if an error
occurs, and the appropriate way to verify for errors is to use the
inline function IS_ERR. The patch will substitute the null-comparison
with IS_ERR.
Signed-off-by: Yeqi Fu <asuk4.q@gmail.com>
---
drivers/edac/altera_edac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 8b31cd54bdb6..19693333408f 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -683,7 +683,7 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci,
return;
drvdata->debugfs_dir = edac_debugfs_create_dir(drvdata->edac_dev_name);
- if (!drvdata->debugfs_dir)
+ if (IS_ERR(drvdata->debugfs_dir))
return;
if (!edac_debugfs_create_file("altr_trigger", S_IWUSR,
--
2.37.2
next reply other threads:[~2023-05-17 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 19:15 Yeqi Fu [this message]
2023-06-07 8:51 ` Borislav Petkov
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=20230517191556.367689-1-asuk4.q@gmail.com \
--to=asuk4.q@gmail.com \
--cc=bp@alien8.de \
--cc=dinguyen@kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.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
all inboxes | Powered by JetHome®