Since debugfs_create_file() returns ERR_PTR and never NULL, use IS_ERR() to check the return value. Fixes: 503efe5cfc9f ("[media] siano: split debugfs code into a separate file") Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx> --- drivers/media/common/siano/smsdvb-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index e0beefd80d7b..16d3b9ab31c5 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -369,7 +369,7 @@ int smsdvb_debugfs_create(struct smsdvb_client_t *client) d = debugfs_create_file("stats", S_IRUGO | S_IWUSR, client->debugfs, client, &debugfs_stats_ops); - if (!d) { + if (IS_ERR(d)) { debugfs_remove(client->debugfs); return -ENOMEM; } -- 2.34.1