mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 15/22] UML - Hostfs failed mount handling
@ 2005-05-01 21:12 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-05-01 21:12 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel

This cleans up the error handling and fixes a crash if a hostfs mount fails.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.11/fs/hostfs/hostfs_kern.c
===================================================================
--- linux-2.6.11.orig/fs/hostfs/hostfs_kern.c	2005-04-21 10:46:18.000000000 -0400
+++ linux-2.6.11/fs/hostfs/hostfs_kern.c	2005-04-21 12:35:24.000000000 -0400
@@ -991,13 +991,17 @@
 		goto out_put;
 
 	err = read_inode(root_inode);
-	if(err)
-		goto out_put;
+	if(err){
+                /* No iput in this case because the dput does that for us */
+                dput(sb->s_root);
+                sb->s_root = NULL;
+		goto out_free;
+        }
 
 	return(0);
 
  out_put:
-	iput(root_inode);
+        iput(root_inode);
  out_free:
 	kfree(name);
  out:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-01 21:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-01 21:12 [PATCH 15/22] UML - Hostfs failed mount handling Jeff Dike

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®