EDAC/altera: Fix error checking
Subsystems (2)
PATCH 1/1 EDAC/altera: Fix error checking
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 <[email protected]>
--- drivers/edac/altera_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/altera_edac.c +1 -1
@@ -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,
Signature · 1 line
2.37.2
Quoted 16 lines · Yeqi Fu
The function
edac_debugfs_create_dirreturnsERR_PTRif an error occurs, and the appropriate way to verify for errors is to use the inline functionIS_ERR. The patch will substitute the null-comparison withIS_ERR.Signed-off-by Yeqi Fu <[email protected]>--- drivers/edac/altera_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/edac/altera_edac.c +0
-0
drivers/edac/altera_edac.c static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci, · line 689
Quoted 8 lines
drivers/edac/altera_edac.c +1
-1@@ -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,
Applied, thanks.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette