edac: Fix error checking
Subsystems (2)
PATCH 1/1 edac: Fix error checking
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 <[email protected]>
--- drivers/edac/thunderx_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/thunderx_edac.c +1 -1
@@ -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 ; }
Signature · 1 line
2.37.2