mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] edac: Fix error checking
@ 2023-05-17 17:31 Yeqi Fu
  0 siblings, 0 replies; only message in thread
From: Yeqi Fu @ 2023-05-17 17:31 UTC (permalink / raw)
  To: rric, bp, tony.luck; +Cc: Yeqi Fu, linux-edac, linux-kernel

The functions edac_debugfs_create_file return 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/thunderx_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c
index 0bcd9f02c84a..b9c5772da959 100644
--- a/drivers/edac/thunderx_edac.c
+++ b/drivers/edac/thunderx_edac.c
@@ -481,7 +481,7 @@ static int thunderx_create_debugfs_nodes(struct dentry *parent,
 		ent = edac_debugfs_create_file(attrs[i]->name, attrs[i]->mode,
 					       parent, data, &attrs[i]->fops);
 
-		if (!ent)
+		if (IS_ERR(ent))
 			break;
 	}
 
-- 
2.37.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-17 17:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 17:31 [PATCH] edac: Fix error checking Yeqi Fu

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®