diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 302a15c505a9..d81e933a796b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1565,8 +1565,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1565 | 1565 | ||
1566 | /* Obtain the value string */ | 1566 | /* Obtain the value string */ |
1567 | value = strchr(data, '='); | 1567 | value = strchr(data, '='); |
1568 | if (value != NULL) | 1568 | value++; |
1569 | *value++ = '\0'; | ||
1570 | 1569 | ||
1571 | /* Set tmp_end to end of the string */ | 1570 | /* Set tmp_end to end of the string */ |
1572 | tmp_end = (char *) value + strlen(value); | 1571 | tmp_end = (char *) value + strlen(value); |
@@ -1649,6 +1648,13 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1649 | goto cifs_parse_mount_err; | 1648 | goto cifs_parse_mount_err; |
1650 | } | 1649 | } |
1651 | 1650 | ||
1651 | vol->UNC = kmalloc(temp_len+1, GFP_KERNEL); | ||
1652 | if (vol->UNC == NULL) { | ||
1653 | printk(KERN_WARNING "CIFS: no memory for UNC\n"); | ||
1654 | goto cifs_parse_mount_err; | ||
1655 | } | ||
1656 | strcpy(vol->UNC, string); | ||
1657 | |||
1652 | if (strncmp(string, "//", 2) == 0) { | 1658 | if (strncmp(string, "//", 2) == 0) { |
1653 | vol->UNC[0] = '\\'; | 1659 | vol->UNC[0] = '\\'; |
1654 | vol->UNC[1] = '\\'; | 1660 | vol->UNC[1] = '\\'; |
@@ -1658,13 +1664,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1658 | goto cifs_parse_mount_err; | 1664 | goto cifs_parse_mount_err; |
1659 | } | 1665 | } |
1660 | 1666 | ||
1661 | vol->UNC = kmalloc(temp_len+1, GFP_KERNEL); | ||
1662 | if (vol->UNC == NULL) { | ||
1663 | printk(KERN_WARNING "CIFS: no memory " | ||
1664 | "for UNC\n"); | ||
1665 | goto cifs_parse_mount_err; | ||
1666 | } | ||
1667 | strcpy(vol->UNC, string); | ||
1668 | break; | 1667 | break; |
1669 | case Opt_domain: | 1668 | case Opt_domain: |
1670 | string = match_strdup(args); | 1669 | string = match_strdup(args); |