cifs: don't leak nls on mount failure
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 17 Jun 2011 12:49:12 +0000 (08:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 24 Jun 2011 22:39:41 +0000 (18:39 -0400)
if cifs_sb allocation fails, we still need to drop nls we'd stashed
into volume_info - the one we would've copied to cifs_sb if we could
allocate the latter.

Acked-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/cifsfs.c

index dc76c7b..bfab2bc 100644 (file)
@@ -672,6 +672,7 @@ cifs_do_mount(struct file_system_type *fs_type,
        cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
        if (cifs_sb == NULL) {
                root = ERR_PTR(-ENOMEM);
+               unload_nls(volume_info->local_nls);
                goto out;
        }