lkml.org 
[lkml]   [2004]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] copy_namespace check for NULL
Hello Andrew,

As far as I can see the copy_tree() function can return NULL, so this
checks for it. Same thing in 2.4, I'll rediff for Marcelo.

Marcus

#
# create_patch: fix_copy_namespace-2004-01-26-A.patch
# Date: Mon Jan 26 21:22:51 EET 2004
#
diff -Naurd --exclude-from=/home/msa/linux/base/diff_exclude linus-2.6.2-rc1-mm2/fs/namespace.c fix_copy_namespace-2.6.2-rc1-mm2/fs/namespace.c
--- linus-2.6.2-rc1-mm2/fs/namespace.c 2004-01-26 19:15:05.000000000 +0000
+++ fix_copy_namespace-2.6.2-rc1-mm2/fs/namespace.c 2004-01-26 19:17:06.000000000 +0000
@@ -822,12 +822,16 @@

atomic_set(&new_ns->count, 1);
init_rwsem(&new_ns->sem);
- new_ns->root = NULL;
INIT_LIST_HEAD(&new_ns->list);

down_write(&tsk->namespace->sem);
/* First pass: copy the tree topology */
new_ns->root = copy_tree(namespace->root, namespace->root->mnt_root);
+ if (!new_ns->root) {
+ up_write(&tsk->namespace->sem);
+ kfree(new_ns);
+ goto out;
+ }
spin_lock(&vfsmount_lock);
list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
spin_unlock(&vfsmount_lock);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.182 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site