virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch] virtio: console: fix error handling for debugfs_create_dir()
@ 2013-07-19  5:50 Dan Carpenter
  2013-07-19  6:13 ` Amit Shah
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Dan Carpenter @ 2013-07-19  5:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Amit Shah, Greg Kroah-Hartman, kernel-janitors, virtualization

debugfs_create_dir() returns ERR_PTR(-ENODEV) if debugfs is disabled.
Also my static checker doesn't like it when we print the error code, but
it's always just NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 1b456fe..ad2cd6d 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -2215,7 +2215,7 @@ static int __init init(void)
 	}
 
 	pdrvdata.debugfs_dir = debugfs_create_dir("virtio-ports", NULL);
-	if (!pdrvdata.debugfs_dir) {
+	if (IS_ERR_OR_NULL(pdrvdata.debugfs_dir)) {
 		pr_warning("Error %ld creating debugfs dir for virtio-ports\n",
 			   PTR_ERR(pdrvdata.debugfs_dir));
 	}

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

end of thread, other threads:[~2013-07-30  6:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-19  5:50 [patch] virtio: console: fix error handling for debugfs_create_dir() Dan Carpenter
2013-07-19  6:13 ` Amit Shah
2013-07-19 10:28 ` Arnd Bergmann
     [not found] ` <201307191228.41794.arnd@arndb.de>
2013-07-20 21:50   ` Dan Carpenter
2013-07-21  9:36     ` Arnd Bergmann
     [not found]     ` <201307211136.25989.arnd@arndb.de>
2013-07-21 15:49       ` Greg Kroah-Hartman
2013-07-21 22:33       ` Dan Carpenter
2013-07-22 20:41   ` [patch v2] virtio: console: cleanup an error message Dan Carpenter
2013-07-23  4:35     ` Greg Kroah-Hartman
2013-07-29  7:11     ` Amit Shah
2013-07-29 13:12       ` Greg Kroah-Hartman
     [not found]       ` <20130729131231.GC3779@kroah.com>
2013-07-29 13:35         ` Dan Carpenter
2013-07-29 13:44           ` Greg Kroah-Hartman
2013-07-30  6:23     ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).