diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/connect.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 87fa16549f27..290c13442f75 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1122,6 +1122,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1122 | separator[1] = 0; | 1122 | separator[1] = 0; |
1123 | delim = separator[0]; | 1123 | delim = separator[0]; |
1124 | 1124 | ||
1125 | /* ensure we always start with zeroed-out smb_vol */ | ||
1126 | memset(vol, 0, sizeof(*vol)); | ||
1127 | |||
1125 | /* | 1128 | /* |
1126 | * does not have to be perfect mapping since field is | 1129 | * does not have to be perfect mapping since field is |
1127 | * informational, only used for servers that do not support | 1130 | * informational, only used for servers that do not support |
@@ -3314,7 +3317,6 @@ expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses, | |||
3314 | mdata = NULL; | 3317 | mdata = NULL; |
3315 | } else { | 3318 | } else { |
3316 | cleanup_volume_info_contents(volume_info); | 3319 | cleanup_volume_info_contents(volume_info); |
3317 | memset(volume_info, '\0', sizeof(*volume_info)); | ||
3318 | rc = cifs_setup_volume_info(volume_info, mdata, | 3320 | rc = cifs_setup_volume_info(volume_info, mdata, |
3319 | fake_devname); | 3321 | fake_devname); |
3320 | } | 3322 | } |
@@ -3336,7 +3338,6 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data, | |||
3336 | if (cifs_parse_mount_options(mount_data, devname, volume_info)) | 3338 | if (cifs_parse_mount_options(mount_data, devname, volume_info)) |
3337 | return -EINVAL; | 3339 | return -EINVAL; |
3338 | 3340 | ||
3339 | |||
3340 | if (volume_info->nullauth) { | 3341 | if (volume_info->nullauth) { |
3341 | cFYI(1, "Anonymous login"); | 3342 | cFYI(1, "Anonymous login"); |
3342 | kfree(volume_info->username); | 3343 | kfree(volume_info->username); |
@@ -3373,7 +3374,7 @@ cifs_get_volume_info(char *mount_data, const char *devname) | |||
3373 | int rc; | 3374 | int rc; |
3374 | struct smb_vol *volume_info; | 3375 | struct smb_vol *volume_info; |
3375 | 3376 | ||
3376 | volume_info = kzalloc(sizeof(struct smb_vol), GFP_KERNEL); | 3377 | volume_info = kmalloc(sizeof(struct smb_vol), GFP_KERNEL); |
3377 | if (!volume_info) | 3378 | if (!volume_info) |
3378 | return ERR_PTR(-ENOMEM); | 3379 | return ERR_PTR(-ENOMEM); |
3379 | 3380 | ||