mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kangjie Lu <kjlu@umn.edu>
To: kjlu@umn.edu
Cc: pakki001@umn.edu, Alexey Dobriyan <adobriyan@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Davidlohr Bueso <dbueso@suse.de>,
	David Howells <dhowells@redhat.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH] fs: proc: check status of register_filesystem
Date: Tue, 25 Dec 2018 21:06:40 -0600	[thread overview]
Message-ID: <20181226030642.72757-1-kjlu@umn.edu> (raw)

register_filesystem() could fail. The fix issues an error message if it
fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 fs/proc/root.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/proc/root.c b/fs/proc/root.c
index f4b1a9d2eca6..7dcd947cba23 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -141,7 +141,8 @@ void __init proc_root_init(void)
 	proc_mkdir("bus", NULL);
 	proc_sys_init();
 
-	register_filesystem(&proc_fs_type);
+	if (register_filesystem(&proc_fs_type))
+		pr_err("failed to register the filesystem.\n");
 }
 
 static int proc_root_getattr(const struct path *path, struct kstat *stat,
-- 
2.17.2 (Apple Git-113)


             reply	other threads:[~2018-12-26  3:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26  3:06 Kangjie Lu [this message]
2018-12-26  6:18 ` Alexey Dobriyan
2018-12-26  6:58   ` Al Viro
2019-01-02  9:38 ` David Howells
2019-01-02  9:38 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181226030642.72757-1-kjlu@umn.edu \
    --to=kjlu@umn.edu \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dbueso@suse.de \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®