All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Prevent oops in nfs_sb_init
@ 2004-03-23 10:17 Olaf Kirch
  2004-03-23 16:00 ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Kirch @ 2004-03-23 10:17 UTC (permalink / raw)
  To: nfs

[-- 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;
 }

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

end of thread, other threads:[~2004-03-23 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-23 10:17 [PATCH] Prevent oops in nfs_sb_init Olaf Kirch
2004-03-23 16:00 ` Trond Myklebust
2004-03-23 16:23   ` Olaf Kirch

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.