All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aspeed-video.c: Fix error checking for debugfs_create_dir
@ 2023-05-24 17:11 Osama Muhammad
  2023-05-30 14:18   ` Eddie James
  0 siblings, 1 reply; 3+ messages in thread
From: Osama Muhammad @ 2023-05-24 17:11 UTC (permalink / raw)
  To: linux-aspeed

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.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
 drivers/media/platform/aspeed/aspeed-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c
index 374eb7781936..97847f44964a 100644
--- a/drivers/media/platform/aspeed/aspeed-video.c
+++ b/drivers/media/platform/aspeed/aspeed-video.c
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-30 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 17:11 [PATCH] aspeed-video.c: Fix error checking for debugfs_create_dir Osama Muhammad
2023-05-30 14:18 ` Eddie James
2023-05-30 14:18   ` Eddie James

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.