[PATCH] EDAC/altera: Fix error checking

From: Yeqi Fu
Date: Wed May 17 2023 - 15:17:11 EST


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@xxxxxxxxx>
---
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