Skip to content

Commit bf5c04d

Browse files
Yeqi Fubp3tk0v
authored andcommitted
EDAC/thunderx: Check debugfs file creation retval properly
edac_debugfs_create_file() returns ERR_PTR by way of the respective debugfs function it calls, if an error occurs. The appropriate way to verify for errors is to use IS_ERR(). Do so. [ bp: Rewrite all text. ] Signed-off-by: Yeqi Fu <asuk4.q@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230517173111.365787-1-asuk4.q@gmail.com
1 parent ac9a786 commit bf5c04d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/edac/thunderx_edac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ static int thunderx_create_debugfs_nodes(struct dentry *parent,
481481
ent = edac_debugfs_create_file(attrs[i]->name, attrs[i]->mode,
482482
parent, data, &attrs[i]->fops);
483483

484-
if (!ent)
484+
if (IS_ERR(ent))
485485
break;
486486
}
487487

0 commit comments

Comments
 (0)