diff mbox series

edac: Fix error checking

Message ID 20230517173111.365787-1-asuk4.q@gmail.com (mailing list archive)
State New, archived
Headers show
Series edac: Fix error checking | expand

Commit Message

Yeqi Fu May 17, 2023, 5:31 p.m. UTC
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 mbox series

Patch

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;
 	}