Linux NFS development
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@suse.de>
To: nfs@lists.sourceforge.net
Subject: [PATCH] Prevent oops in nfs_sb_init
Date: Tue, 23 Mar 2004 11:17:40 +0100	[thread overview]
Message-ID: <20040323101740.GE24978@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

nfs_sb_init will crash when the fsinfo call fails, because
it tries to iput() an uninitialized pointer. The attached patch
should fix this.

Olaf
-- 
Olaf Kirch     |  Stop wasting entropy - start using predictable
okir@suse.de   |  tempfile names today!
---------------+ 

[-- Attachment #2: nfs-mount-fail-crash --]
[-- Type: text/plain, Size: 634 bytes --]

--- linux-2.6.4/fs/nfs/inode.c.orig	2004-03-22 17:21:52.000000000 +0100
+++ linux-2.6.4/fs/nfs/inode.c	2004-03-23 11:13:17.000000000 +0100
@@ -277,7 +277,7 @@
 nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor)
 {
 	struct nfs_server	*server;
-	struct inode		*root_inode;
+	struct inode		*root_inode = NULL;
 	struct nfs_fattr	fattr;
 	struct nfs_fsinfo	fsinfo = {
 					.fattr = &fattr,
@@ -361,7 +361,7 @@
 	/* Yargs. It didn't work out. */
 out_no_root:
 	printk("nfs_read_super: get root inode failed\n");
-	if (!IS_ERR(root_inode))
+	if (root_inode && !IS_ERR(root_inode))
 		iput(root_inode);
 	return -EINVAL;
 }

             reply	other threads:[~2004-03-23 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-23 10:17 Olaf Kirch [this message]
2004-03-23 16:00 ` [PATCH] Prevent oops in nfs_sb_init Trond Myklebust
2004-03-23 16:23   ` Olaf Kirch

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=20040323101740.GE24978@suse.de \
    --to=okir@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /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