Skip to contentSkip to conversation

open_meta_file (meta_fs.c) error reporting fix.

PATCH New Piotr Neuman 1 participant 1 message Oct 16, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 open_meta_file (meta_fs.c) error reporting fix.

Small bug in open_meta_file() prevents error reporting if memory allocation in get_path() fails (pretty unprobable but still).

Fix included (applies to UML ver. 2.6.8-um1 + externfs patch).

fs/hostfs/meta_fs.c renamed from fs/hostfs/meta_fs.c.old +3 -1
@@ -83,8 +83,10 @@ static int open_meta_file(const char *pa
 		goto out;
 
 	meta_file = get_path(meta_path, meta_tmp, sizeof(meta_tmp));
-	if(meta_file == NULL)
+	if(meta_file == NULL) {
+		err = -ENOMEM;
 		goto out;
+	}
 	
 	err = open_filehandle(meta_file, of_rdwr(OPENFLAGS()), 0, fh);
 	if(err)