Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254037
b: refs/heads/master
c: 5d3bc60
h: refs/heads/master
i:
  254035: 2632e9b
v: v3
  • Loading branch information
Al Viro committed Jun 24, 2011
1 parent 96b4c7a commit 4fe4b6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d687ca380f1a8f3043f42efd2403cbe58c846e70
refs/heads/master: 5d3bc605cafe3f367b1c43b673bf643245c81626
21 changes: 10 additions & 11 deletions trunk/fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,14 @@ cifs_do_mount(struct file_system_type *fs_type,
goto out;
}

cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
if (cifs_sb->mountdata == NULL) {
root = ERR_PTR(-ENOMEM);
unload_nls(volume_info->local_nls);
kfree(cifs_sb);
goto out;
}

cifs_setup_cifs_sb(volume_info, cifs_sb);

mnt_data.vol = volume_info;
Expand All @@ -701,22 +709,12 @@ cifs_do_mount(struct file_system_type *fs_type,

if (sb->s_fs_info) {
cFYI(1, "Use existing superblock");
kfree(cifs_sb->mountdata);
unload_nls(cifs_sb->local_nls);
kfree(cifs_sb);
goto out_shared;
}

/*
* Copy mount params for use in submounts. Better to do
* the copy here and deal with the error before cleanup gets
* complicated post-mount.
*/
cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
if (cifs_sb->mountdata == NULL) {
root = ERR_PTR(-ENOMEM);
goto out_super;
}

sb->s_flags = flags;
/* BB should we make this contingent on mount parm? */
sb->s_flags |= MS_NODIRATIME | MS_NOATIME;
Expand Down Expand Up @@ -749,6 +747,7 @@ cifs_do_mount(struct file_system_type *fs_type,
goto out;

out_cifs_sb:
kfree(cifs_sb->mountdata);
unload_nls(cifs_sb->local_nls);
kfree(cifs_sb);

Expand Down

0 comments on commit 4fe4b6a

Please sign in to comment.