lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] smsdvb-debugfs.c: Fix error checking for debugfs_create_file
Date
This patch fixes the error checking in smsdvb-debugfs.c in
debugfs_create_file. The correct way to check if an error occurred
is using 'IS_ERR_OR_NULL' inline function.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
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 8916bb644756..0f8750d7993c 100644
--- a/drivers/media/common/siano/smsdvb-debugfs.c
+++ b/drivers/media/common/siano/smsdvb-debugfs.c
@@ -469,7 +469,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_OR_NULL(d)) {
debugfs_remove(client->debugfs);
return -ENOMEM;
}
--
2.34.1
\
 
 \ /
  Last update: 2023-05-24 18:43    [W:0.049 / U:22.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site