diff options
author | David Howells <dhowells@redhat.com> | 2012-06-25 12:55:18 +0100 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-04-03 14:55:50 +0200 |
commit | 14df004d01cf1e919471fdf32cf97e7a7169178b (patch) | |
tree | 2b80f37d9d41dcf307c2f3d9126f9646584c6fb4 /kernel | |
parent | 7c733a6e7f1caa59c25830eac1d00913a5c3064a (diff) | |
download | kernel_samsung_tuna-14df004d01cf1e919471fdf32cf97e7a7169178b.zip kernel_samsung_tuna-14df004d01cf1e919471fdf32cf97e7a7169178b.tar.gz kernel_samsung_tuna-14df004d01cf1e919471fdf32cf97e7a7169178b.tar.bz2 |
VFS: Make clone_mnt()/copy_tree()/collect_mounts() return errors
copy_tree() can theoretically fail in a case other than ENOMEM, but always
returns NULL which is interpreted by callers as -ENOMEM. Change it to return
an explicit error.
Also change clone_mnt() for consistency and because union mounts will add new
error cases.
Thanks to Andreas Gruenbacher <agruen@suse.de> for a bug fix.
[AV: folded braino fix by Dan Carpenter]
Original-author: Valerie Aurora <vaurora@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Valerie Aurora <valerie.aurora@gmail.com>
Cc: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit be34d1a3bc4b6f357a49acb55ae870c81337e4f0)
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit_tree.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c index 7d9731d..5c37db2 100644 --- a/kernel/audit_tree.c +++ b/kernel/audit_tree.c @@ -600,7 +600,7 @@ void audit_trim_trees(void) root_mnt = collect_mounts(&path); path_put(&path); - if (!root_mnt) + if (IS_ERR(root_mnt)) goto skip_it; spin_lock(&hash_lock); @@ -674,8 +674,8 @@ int audit_add_tree_rule(struct audit_krule *rule) goto Err; mnt = collect_mounts(&path); path_put(&path); - if (!mnt) { - err = -ENOMEM; + if (IS_ERR(mnt)) { + err = PTR_ERR(mnt); goto Err; } @@ -724,8 +724,8 @@ int audit_tag_tree(char *old, char *new) return err; tagged = collect_mounts(&path2); path_put(&path2); - if (!tagged) - return -ENOMEM; + if (IS_ERR(tagged)) + return PTR_ERR(tagged); err = kern_path(old, 0, &path1); if (err) { |