Delete pcibios_select_root
[safe/jmp/linux-2.6] / kernel / audit_tree.c
index 48bddad..1f6396d 100644 (file)
@@ -385,6 +385,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
        mutex_lock(&inode->inotify_mutex);
        if (inotify_clone_watch(&old->watch, &chunk->watch) < 0) {
                mutex_unlock(&inode->inotify_mutex);
+               put_inotify_watch(&old->watch);
                free_chunk(chunk);
                return -ENOSPC;
        }
@@ -394,6 +395,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
                chunk->dead = 1;
                inotify_evict_watch(&chunk->watch);
                mutex_unlock(&inode->inotify_mutex);
+               put_inotify_watch(&old->watch);
                put_inotify_watch(&chunk->watch);
                return 0;
        }
@@ -566,7 +568,7 @@ void audit_trim_trees(void)
                if (err)
                        goto skip_it;
 
-               root_mnt = collect_mounts(path.mnt, path.dentry);
+               root_mnt = collect_mounts(&path);
                path_put(&path);
                if (!root_mnt)
                        goto skip_it;
@@ -618,7 +620,7 @@ int audit_make_tree(struct audit_krule *rule, char *pathname, u32 op)
 
        if (pathname[0] != '/' ||
            rule->listnr != AUDIT_FILTER_EXIT ||
-           op & ~AUDIT_EQUAL ||
+           op != Audit_equal ||
            rule->inode_f || rule->watch || rule->tree)
                return -EINVAL;
        rule->tree = alloc_tree(pathname);
@@ -658,7 +660,7 @@ int audit_add_tree_rule(struct audit_krule *rule)
        err = kern_path(tree->pathname, 0, &path);
        if (err)
                goto Err;
-       mnt = collect_mounts(path.mnt, path.dentry);
+       mnt = collect_mounts(&path);
        path_put(&path);
        if (!mnt) {
                err = -ENOMEM;
@@ -718,7 +720,7 @@ int audit_tag_tree(char *old, char *new)
        err = kern_path(new, 0, &path);
        if (err)
                return err;
-       tagged = collect_mounts(path.mnt, path.dentry);
+       tagged = collect_mounts(&path);
        path_put(&path);
        if (!tagged)
                return -ENOMEM;
@@ -732,9 +734,6 @@ int audit_tag_tree(char *old, char *new)
        dentry = dget(path.dentry);
        path_put(&path);
 
-       if (dentry == tagged->mnt_root && dentry == mnt->mnt_root)
-               follow_up(&mnt, &dentry);
-
        list_add_tail(&list, &tagged->mnt_list);
 
        mutex_lock(&audit_filter_mutex);