summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-17 14:49:12 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2011-06-25 00:39:41 +0200
commitca171baaad1420a29cca98be5bdf5596cd70b294 (patch)
tree0b689378dfa3b10002f60d57b68b4fee05b4e94b /fs/cifs/cifsfs.c
parentcifs: double free on mount failure (diff)
downloadlinux-ca171baaad1420a29cca98be5bdf5596cd70b294.tar.xz
linux-ca171baaad1420a29cca98be5bdf5596cd70b294.zip
cifs: don't leak nls on mount failure
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>
Diffstat (limited to '')
-rw-r--r--fs/cifs/cifsfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index dc76c7bccb15..bfab2bc83726 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -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;
}