diff options
author | Pavel Shilovsky <piastryyy@gmail.com> | 2011-06-20 12:33:16 +0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-06-22 21:43:56 +0000 |
commit | 446b23a75804d7ffa4cca2d4d8f0afb822108c7e (patch) | |
tree | b39afe031f24ce3c79df35d32381f5331d6b68db /fs/cifs/connect.c | |
parent | 2992c4bd5742b31a0ee00a76eee9c1c284507418 (diff) |
CIFS: Fix problem with 3.0-rc1 null user mount failure
Figured it out: it was broken by b946845a9dc523c759cae2b6a0f6827486c3221a commit - "cifs: cifs_parse_mount_options: do not tokenize mount options in-place". So, as a quick fix I suggest to apply this patch.
[PATCH] CIFS: Fix kfree() with constant string in a null user case
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 12cf72dd0c42..19fdbda7aa95 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2937,7 +2937,11 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data, if (volume_info->nullauth) { cFYI(1, "null user"); - volume_info->username = ""; + volume_info->username = kzalloc(1, GFP_KERNEL); + if (volume_info->username == NULL) { + rc = -ENOMEM; + goto out; + } } else if (volume_info->username) { /* BB fixme parse for domain name here */ cFYI(1, "Username: %s", volume_info->username); |