Skip to contentSkip to conversation

aspeed-video.c: Fix error checking for debugfs_create_dir

PATCH Superseded Osama Muhammad 2 participants 2 messages May 24, 2023 – May 30, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aspeed-video.c: Fix error checking for debugfs_create_dir

This patch fixes the error checking in aspeed-video.c in debugfs_create_dir. The correct way to check if an error occurred is using 'IS_ERR' inline function.

---
 drivers/media/platform/aspeed/aspeed-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/aspeed/aspeed-video.c +1 -1
index 374eb7781936..97847f44964a 100644
@@ -1976,7 +1976,7 @@ static int aspeed_video_debugfs_create(struct aspeed_video *video)
 	debugfs_entry = debugfs_create_file(DEVICE_NAME, 0444, NULL,
 					    video,
 					    &aspeed_video_debugfs_fops);
-	if (!debugfs_entry)
+	if (IS_ERR(debugfs_entry))
 		aspeed_video_debugfs_remove(video);
 
 	return !debugfs_entry ? -EIO : 0;
Signature · 1 line
2.34.1
maintainer
#1 lore raw

PATCH 1/1 aspeed-video.c: Fix error checking for debugfs_create_dir

Quoted 3 lines · Osama Muhammad

This patch fixes the error checking in aspeed-video.c in debugfs_create_dir. The correct way to check if an error occurred is using 'IS_ERR' inline function.

Thanks.

Quoted 19 lines
---
  drivers/media/platform/aspeed/aspeed-video.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/aspeed/aspeed-video.c +1 -1
index 374eb7781936..97847f44964a 100644
@@ -1976,7 +1976,7 @@ static int aspeed_video_debugfs_create(struct aspeed_video *video)
  	debugfs_entry = debugfs_create_file(DEVICE_NAME, 0444, NULL,
  					    video,
  					    &aspeed_video_debugfs_fops);
-	if (!debugfs_entry)
+	if (IS_ERR(debugfs_entry))
  		aspeed_video_debugfs_remove(video);
 
  	return !debugfs_entry ? -EIO : 0;