diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-17 09:50:44 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-24 18:39:42 -0400 |
commit | fa18f1bdce898f0efd0c8639c901d826d01be04f (patch) | |
tree | 1165e5c3172792bf9d9ce4340380b9e7c73b7499 /fs | |
parent | ee01a14d9ddcf3f832f9ceb837888501cb496e27 (diff) | |
download | linux-3.10-fa18f1bdce898f0efd0c8639c901d826d01be04f.tar.gz linux-3.10-fa18f1bdce898f0efd0c8639c901d826d01be04f.tar.bz2 linux-3.10-fa18f1bdce898f0efd0c8639c901d826d01be04f.zip |
cifs: more breakage on mount failures
if cifs_get_root() fails, we end up with ->mount() returning NULL,
which is not what callers expect. Moreover, in case of superblock
reuse we end up leaking a superblock reference...
Acked-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsfs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index ba2b2da360d..234e9d08db7 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -710,19 +710,16 @@ cifs_do_mount(struct file_system_type *fs_type, sb->s_flags |= MS_ACTIVE; +out_shared: root = cifs_get_root(volume_info, sb); - if (root == NULL) + if (root == NULL) { + root = ERR_PTR(-EINVAL); /* XXX */ goto out_super; + } cFYI(1, "dentry root is: %p", root); goto out; -out_shared: - root = cifs_get_root(volume_info, sb); - if (root) - cFYI(1, "dentry root is: %p", root); - goto out; - out_super: deactivate_locked_super(sb); out: |