diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e568cc47a7f9..3217ac5f6bd7 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -836,7 +836,7 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
836 | /* go from value to value + temp_len condensing | 836 | /* go from value to value + temp_len condensing |
837 | double commas to singles. Note that this ends up | 837 | double commas to singles. Note that this ends up |
838 | allocating a few bytes too many, which is ok */ | 838 | allocating a few bytes too many, which is ok */ |
839 | vol->password = kcalloc(1, temp_len, GFP_KERNEL); | 839 | vol->password = kzalloc(temp_len, GFP_KERNEL); |
840 | if(vol->password == NULL) { | 840 | if(vol->password == NULL) { |
841 | printk("CIFS: no memory for pass\n"); | 841 | printk("CIFS: no memory for pass\n"); |
842 | return 1; | 842 | return 1; |
@@ -851,7 +851,7 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
851 | } | 851 | } |
852 | vol->password[j] = 0; | 852 | vol->password[j] = 0; |
853 | } else { | 853 | } else { |
854 | vol->password = kcalloc(1, temp_len+1, GFP_KERNEL); | 854 | vol->password = kzalloc(temp_len+1, GFP_KERNEL); |
855 | if(vol->password == NULL) { | 855 | if(vol->password == NULL) { |
856 | printk("CIFS: no memory for pass\n"); | 856 | printk("CIFS: no memory for pass\n"); |
857 | return 1; | 857 | return 1; |
@@ -1317,7 +1317,7 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, | |||
1317 | sessinit is sent but no second negprot */ | 1317 | sessinit is sent but no second negprot */ |
1318 | struct rfc1002_session_packet * ses_init_buf; | 1318 | struct rfc1002_session_packet * ses_init_buf; |
1319 | struct smb_hdr * smb_buf; | 1319 | struct smb_hdr * smb_buf; |
1320 | ses_init_buf = kcalloc(1, sizeof(struct rfc1002_session_packet), GFP_KERNEL); | 1320 | ses_init_buf = kzalloc(sizeof(struct rfc1002_session_packet), GFP_KERNEL); |
1321 | if(ses_init_buf) { | 1321 | if(ses_init_buf) { |
1322 | ses_init_buf->trailer.session_req.called_len = 32; | 1322 | ses_init_buf->trailer.session_req.called_len = 32; |
1323 | rfc1002mangle(ses_init_buf->trailer.session_req.called_name, | 1323 | rfc1002mangle(ses_init_buf->trailer.session_req.called_name, |
@@ -1964,7 +1964,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
1964 | /* We look for obvious messed up bcc or strings in response so we do not go off | 1964 | /* We look for obvious messed up bcc or strings in response so we do not go off |
1965 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 1965 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
1966 | terminating last Unicode string in response */ | 1966 | terminating last Unicode string in response */ |
1967 | ses->serverOS = kcalloc(1, 2 * (len + 1), GFP_KERNEL); | 1967 | ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); |
1968 | if(ses->serverOS == NULL) | 1968 | if(ses->serverOS == NULL) |
1969 | goto sesssetup_nomem; | 1969 | goto sesssetup_nomem; |
1970 | cifs_strfromUCS_le(ses->serverOS, | 1970 | cifs_strfromUCS_le(ses->serverOS, |
@@ -1976,7 +1976,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
1976 | if (remaining_words > 0) { | 1976 | if (remaining_words > 0) { |
1977 | len = UniStrnlen((wchar_t *)bcc_ptr, | 1977 | len = UniStrnlen((wchar_t *)bcc_ptr, |
1978 | remaining_words-1); | 1978 | remaining_words-1); |
1979 | ses->serverNOS = kcalloc(1, 2 * (len + 1),GFP_KERNEL); | 1979 | ses->serverNOS = kzalloc(2 * (len + 1),GFP_KERNEL); |
1980 | if(ses->serverNOS == NULL) | 1980 | if(ses->serverNOS == NULL) |
1981 | goto sesssetup_nomem; | 1981 | goto sesssetup_nomem; |
1982 | cifs_strfromUCS_le(ses->serverNOS, | 1982 | cifs_strfromUCS_le(ses->serverNOS, |
@@ -1994,7 +1994,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
1994 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 1994 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
1995 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ | 1995 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ |
1996 | ses->serverDomain = | 1996 | ses->serverDomain = |
1997 | kcalloc(1, 2*(len+1),GFP_KERNEL); | 1997 | kzalloc(2*(len+1),GFP_KERNEL); |
1998 | if(ses->serverDomain == NULL) | 1998 | if(ses->serverDomain == NULL) |
1999 | goto sesssetup_nomem; | 1999 | goto sesssetup_nomem; |
2000 | cifs_strfromUCS_le(ses->serverDomain, | 2000 | cifs_strfromUCS_le(ses->serverDomain, |
@@ -2005,22 +2005,22 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2005 | } /* else no more room so create dummy domain string */ | 2005 | } /* else no more room so create dummy domain string */ |
2006 | else | 2006 | else |
2007 | ses->serverDomain = | 2007 | ses->serverDomain = |
2008 | kcalloc(1, 2, GFP_KERNEL); | 2008 | kzalloc(2, GFP_KERNEL); |
2009 | } else { /* no room so create dummy domain and NOS string */ | 2009 | } else { /* no room so create dummy domain and NOS string */ |
2010 | /* if these kcallocs fail not much we | 2010 | /* if these kcallocs fail not much we |
2011 | can do, but better to not fail the | 2011 | can do, but better to not fail the |
2012 | sesssetup itself */ | 2012 | sesssetup itself */ |
2013 | ses->serverDomain = | 2013 | ses->serverDomain = |
2014 | kcalloc(1, 2, GFP_KERNEL); | 2014 | kzalloc(2, GFP_KERNEL); |
2015 | ses->serverNOS = | 2015 | ses->serverNOS = |
2016 | kcalloc(1, 2, GFP_KERNEL); | 2016 | kzalloc(2, GFP_KERNEL); |
2017 | } | 2017 | } |
2018 | } else { /* ASCII */ | 2018 | } else { /* ASCII */ |
2019 | len = strnlen(bcc_ptr, 1024); | 2019 | len = strnlen(bcc_ptr, 1024); |
2020 | if (((long) bcc_ptr + len) - (long) | 2020 | if (((long) bcc_ptr + len) - (long) |
2021 | pByteArea(smb_buffer_response) | 2021 | pByteArea(smb_buffer_response) |
2022 | <= BCC(smb_buffer_response)) { | 2022 | <= BCC(smb_buffer_response)) { |
2023 | ses->serverOS = kcalloc(1, len + 1,GFP_KERNEL); | 2023 | ses->serverOS = kzalloc(len + 1,GFP_KERNEL); |
2024 | if(ses->serverOS == NULL) | 2024 | if(ses->serverOS == NULL) |
2025 | goto sesssetup_nomem; | 2025 | goto sesssetup_nomem; |
2026 | strncpy(ses->serverOS,bcc_ptr, len); | 2026 | strncpy(ses->serverOS,bcc_ptr, len); |
@@ -2030,7 +2030,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2030 | bcc_ptr++; | 2030 | bcc_ptr++; |
2031 | 2031 | ||
2032 | len = strnlen(bcc_ptr, 1024); | 2032 | len = strnlen(bcc_ptr, 1024); |
2033 | ses->serverNOS = kcalloc(1, len + 1,GFP_KERNEL); | 2033 | ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); |
2034 | if(ses->serverNOS == NULL) | 2034 | if(ses->serverNOS == NULL) |
2035 | goto sesssetup_nomem; | 2035 | goto sesssetup_nomem; |
2036 | strncpy(ses->serverNOS, bcc_ptr, len); | 2036 | strncpy(ses->serverNOS, bcc_ptr, len); |
@@ -2039,7 +2039,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2039 | bcc_ptr++; | 2039 | bcc_ptr++; |
2040 | 2040 | ||
2041 | len = strnlen(bcc_ptr, 1024); | 2041 | len = strnlen(bcc_ptr, 1024); |
2042 | ses->serverDomain = kcalloc(1, len + 1,GFP_KERNEL); | 2042 | ses->serverDomain = kzalloc(len + 1,GFP_KERNEL); |
2043 | if(ses->serverDomain == NULL) | 2043 | if(ses->serverDomain == NULL) |
2044 | goto sesssetup_nomem; | 2044 | goto sesssetup_nomem; |
2045 | strncpy(ses->serverDomain, bcc_ptr, len); | 2045 | strncpy(ses->serverDomain, bcc_ptr, len); |
@@ -2240,7 +2240,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2240 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 2240 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
2241 | terminating last Unicode string in response */ | 2241 | terminating last Unicode string in response */ |
2242 | ses->serverOS = | 2242 | ses->serverOS = |
2243 | kcalloc(1, 2 * (len + 1), GFP_KERNEL); | 2243 | kzalloc(2 * (len + 1), GFP_KERNEL); |
2244 | cifs_strfromUCS_le(ses->serverOS, | 2244 | cifs_strfromUCS_le(ses->serverOS, |
2245 | (wchar_t *) | 2245 | (wchar_t *) |
2246 | bcc_ptr, len, | 2246 | bcc_ptr, len, |
@@ -2254,7 +2254,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2254 | remaining_words | 2254 | remaining_words |
2255 | - 1); | 2255 | - 1); |
2256 | ses->serverNOS = | 2256 | ses->serverNOS = |
2257 | kcalloc(1, 2 * (len + 1), | 2257 | kzalloc(2 * (len + 1), |
2258 | GFP_KERNEL); | 2258 | GFP_KERNEL); |
2259 | cifs_strfromUCS_le(ses->serverNOS, | 2259 | cifs_strfromUCS_le(ses->serverNOS, |
2260 | (wchar_t *)bcc_ptr, | 2260 | (wchar_t *)bcc_ptr, |
@@ -2267,7 +2267,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2267 | if (remaining_words > 0) { | 2267 | if (remaining_words > 0) { |
2268 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 2268 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
2269 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ | 2269 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ |
2270 | ses->serverDomain = kcalloc(1, 2*(len+1),GFP_KERNEL); | 2270 | ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); |
2271 | cifs_strfromUCS_le(ses->serverDomain, | 2271 | cifs_strfromUCS_le(ses->serverDomain, |
2272 | (wchar_t *)bcc_ptr, | 2272 | (wchar_t *)bcc_ptr, |
2273 | len, | 2273 | len, |
@@ -2278,10 +2278,10 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2278 | } /* else no more room so create dummy domain string */ | 2278 | } /* else no more room so create dummy domain string */ |
2279 | else | 2279 | else |
2280 | ses->serverDomain = | 2280 | ses->serverDomain = |
2281 | kcalloc(1, 2,GFP_KERNEL); | 2281 | kzalloc(2,GFP_KERNEL); |
2282 | } else { /* no room so create dummy domain and NOS string */ | 2282 | } else { /* no room so create dummy domain and NOS string */ |
2283 | ses->serverDomain = kcalloc(1, 2, GFP_KERNEL); | 2283 | ses->serverDomain = kzalloc(2, GFP_KERNEL); |
2284 | ses->serverNOS = kcalloc(1, 2, GFP_KERNEL); | 2284 | ses->serverNOS = kzalloc(2, GFP_KERNEL); |
2285 | } | 2285 | } |
2286 | } else { /* ASCII */ | 2286 | } else { /* ASCII */ |
2287 | 2287 | ||
@@ -2289,7 +2289,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2289 | if (((long) bcc_ptr + len) - (long) | 2289 | if (((long) bcc_ptr + len) - (long) |
2290 | pByteArea(smb_buffer_response) | 2290 | pByteArea(smb_buffer_response) |
2291 | <= BCC(smb_buffer_response)) { | 2291 | <= BCC(smb_buffer_response)) { |
2292 | ses->serverOS = kcalloc(1, len + 1, GFP_KERNEL); | 2292 | ses->serverOS = kzalloc(len + 1, GFP_KERNEL); |
2293 | strncpy(ses->serverOS, bcc_ptr, len); | 2293 | strncpy(ses->serverOS, bcc_ptr, len); |
2294 | 2294 | ||
2295 | bcc_ptr += len; | 2295 | bcc_ptr += len; |
@@ -2297,14 +2297,14 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2297 | bcc_ptr++; | 2297 | bcc_ptr++; |
2298 | 2298 | ||
2299 | len = strnlen(bcc_ptr, 1024); | 2299 | len = strnlen(bcc_ptr, 1024); |
2300 | ses->serverNOS = kcalloc(1, len + 1,GFP_KERNEL); | 2300 | ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); |
2301 | strncpy(ses->serverNOS, bcc_ptr, len); | 2301 | strncpy(ses->serverNOS, bcc_ptr, len); |
2302 | bcc_ptr += len; | 2302 | bcc_ptr += len; |
2303 | bcc_ptr[0] = 0; | 2303 | bcc_ptr[0] = 0; |
2304 | bcc_ptr++; | 2304 | bcc_ptr++; |
2305 | 2305 | ||
2306 | len = strnlen(bcc_ptr, 1024); | 2306 | len = strnlen(bcc_ptr, 1024); |
2307 | ses->serverDomain = kcalloc(1, len + 1, GFP_KERNEL); | 2307 | ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); |
2308 | strncpy(ses->serverDomain, bcc_ptr, len); | 2308 | strncpy(ses->serverDomain, bcc_ptr, len); |
2309 | bcc_ptr += len; | 2309 | bcc_ptr += len; |
2310 | bcc_ptr[0] = 0; | 2310 | bcc_ptr[0] = 0; |
@@ -2554,7 +2554,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2554 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 2554 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
2555 | terminating last Unicode string in response */ | 2555 | terminating last Unicode string in response */ |
2556 | ses->serverOS = | 2556 | ses->serverOS = |
2557 | kcalloc(1, 2 * (len + 1), GFP_KERNEL); | 2557 | kzalloc(2 * (len + 1), GFP_KERNEL); |
2558 | cifs_strfromUCS_le(ses->serverOS, | 2558 | cifs_strfromUCS_le(ses->serverOS, |
2559 | (wchar_t *) | 2559 | (wchar_t *) |
2560 | bcc_ptr, len, | 2560 | bcc_ptr, len, |
@@ -2569,7 +2569,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2569 | remaining_words | 2569 | remaining_words |
2570 | - 1); | 2570 | - 1); |
2571 | ses->serverNOS = | 2571 | ses->serverNOS = |
2572 | kcalloc(1, 2 * (len + 1), | 2572 | kzalloc(2 * (len + 1), |
2573 | GFP_KERNEL); | 2573 | GFP_KERNEL); |
2574 | cifs_strfromUCS_le(ses-> | 2574 | cifs_strfromUCS_le(ses-> |
2575 | serverNOS, | 2575 | serverNOS, |
@@ -2586,7 +2586,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2586 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 2586 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
2587 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ | 2587 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ |
2588 | ses->serverDomain = | 2588 | ses->serverDomain = |
2589 | kcalloc(1, 2 * | 2589 | kzalloc(2 * |
2590 | (len + | 2590 | (len + |
2591 | 1), | 2591 | 1), |
2592 | GFP_KERNEL); | 2592 | GFP_KERNEL); |
@@ -2612,13 +2612,13 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2612 | } /* else no more room so create dummy domain string */ | 2612 | } /* else no more room so create dummy domain string */ |
2613 | else | 2613 | else |
2614 | ses->serverDomain = | 2614 | ses->serverDomain = |
2615 | kcalloc(1, 2, | 2615 | kzalloc(2, |
2616 | GFP_KERNEL); | 2616 | GFP_KERNEL); |
2617 | } else { /* no room so create dummy domain and NOS string */ | 2617 | } else { /* no room so create dummy domain and NOS string */ |
2618 | ses->serverDomain = | 2618 | ses->serverDomain = |
2619 | kcalloc(1, 2, GFP_KERNEL); | 2619 | kzalloc(2, GFP_KERNEL); |
2620 | ses->serverNOS = | 2620 | ses->serverNOS = |
2621 | kcalloc(1, 2, GFP_KERNEL); | 2621 | kzalloc(2, GFP_KERNEL); |
2622 | } | 2622 | } |
2623 | } else { /* ASCII */ | 2623 | } else { /* ASCII */ |
2624 | len = strnlen(bcc_ptr, 1024); | 2624 | len = strnlen(bcc_ptr, 1024); |
@@ -2626,7 +2626,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2626 | pByteArea(smb_buffer_response) | 2626 | pByteArea(smb_buffer_response) |
2627 | <= BCC(smb_buffer_response)) { | 2627 | <= BCC(smb_buffer_response)) { |
2628 | ses->serverOS = | 2628 | ses->serverOS = |
2629 | kcalloc(1, len + 1, | 2629 | kzalloc(len + 1, |
2630 | GFP_KERNEL); | 2630 | GFP_KERNEL); |
2631 | strncpy(ses->serverOS, | 2631 | strncpy(ses->serverOS, |
2632 | bcc_ptr, len); | 2632 | bcc_ptr, len); |
@@ -2637,7 +2637,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2637 | 2637 | ||
2638 | len = strnlen(bcc_ptr, 1024); | 2638 | len = strnlen(bcc_ptr, 1024); |
2639 | ses->serverNOS = | 2639 | ses->serverNOS = |
2640 | kcalloc(1, len + 1, | 2640 | kzalloc(len + 1, |
2641 | GFP_KERNEL); | 2641 | GFP_KERNEL); |
2642 | strncpy(ses->serverNOS, bcc_ptr, len); | 2642 | strncpy(ses->serverNOS, bcc_ptr, len); |
2643 | bcc_ptr += len; | 2643 | bcc_ptr += len; |
@@ -2646,7 +2646,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2646 | 2646 | ||
2647 | len = strnlen(bcc_ptr, 1024); | 2647 | len = strnlen(bcc_ptr, 1024); |
2648 | ses->serverDomain = | 2648 | ses->serverDomain = |
2649 | kcalloc(1, len + 1, | 2649 | kzalloc(len + 1, |
2650 | GFP_KERNEL); | 2650 | GFP_KERNEL); |
2651 | strncpy(ses->serverDomain, bcc_ptr, len); | 2651 | strncpy(ses->serverDomain, bcc_ptr, len); |
2652 | bcc_ptr += len; | 2652 | bcc_ptr += len; |
@@ -2948,7 +2948,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2948 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 2948 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
2949 | terminating last Unicode string in response */ | 2949 | terminating last Unicode string in response */ |
2950 | ses->serverOS = | 2950 | ses->serverOS = |
2951 | kcalloc(1, 2 * (len + 1), GFP_KERNEL); | 2951 | kzalloc(2 * (len + 1), GFP_KERNEL); |
2952 | cifs_strfromUCS_le(ses->serverOS, | 2952 | cifs_strfromUCS_le(ses->serverOS, |
2953 | (wchar_t *) | 2953 | (wchar_t *) |
2954 | bcc_ptr, len, | 2954 | bcc_ptr, len, |
@@ -2963,7 +2963,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2963 | remaining_words | 2963 | remaining_words |
2964 | - 1); | 2964 | - 1); |
2965 | ses->serverNOS = | 2965 | ses->serverNOS = |
2966 | kcalloc(1, 2 * (len + 1), | 2966 | kzalloc(2 * (len + 1), |
2967 | GFP_KERNEL); | 2967 | GFP_KERNEL); |
2968 | cifs_strfromUCS_le(ses-> | 2968 | cifs_strfromUCS_le(ses-> |
2969 | serverNOS, | 2969 | serverNOS, |
@@ -2979,7 +2979,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2979 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 2979 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
2980 | /* last string not always null terminated (e.g. for Windows XP & 2000) */ | 2980 | /* last string not always null terminated (e.g. for Windows XP & 2000) */ |
2981 | ses->serverDomain = | 2981 | ses->serverDomain = |
2982 | kcalloc(1, 2 * | 2982 | kzalloc(2 * |
2983 | (len + | 2983 | (len + |
2984 | 1), | 2984 | 1), |
2985 | GFP_KERNEL); | 2985 | GFP_KERNEL); |
@@ -3004,17 +3004,17 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3004 | = 0; | 3004 | = 0; |
3005 | } /* else no more room so create dummy domain string */ | 3005 | } /* else no more room so create dummy domain string */ |
3006 | else | 3006 | else |
3007 | ses->serverDomain = kcalloc(1, 2,GFP_KERNEL); | 3007 | ses->serverDomain = kzalloc(2,GFP_KERNEL); |
3008 | } else { /* no room so create dummy domain and NOS string */ | 3008 | } else { /* no room so create dummy domain and NOS string */ |
3009 | ses->serverDomain = kcalloc(1, 2, GFP_KERNEL); | 3009 | ses->serverDomain = kzalloc(2, GFP_KERNEL); |
3010 | ses->serverNOS = kcalloc(1, 2, GFP_KERNEL); | 3010 | ses->serverNOS = kzalloc(2, GFP_KERNEL); |
3011 | } | 3011 | } |
3012 | } else { /* ASCII */ | 3012 | } else { /* ASCII */ |
3013 | len = strnlen(bcc_ptr, 1024); | 3013 | len = strnlen(bcc_ptr, 1024); |
3014 | if (((long) bcc_ptr + len) - | 3014 | if (((long) bcc_ptr + len) - |
3015 | (long) pByteArea(smb_buffer_response) | 3015 | (long) pByteArea(smb_buffer_response) |
3016 | <= BCC(smb_buffer_response)) { | 3016 | <= BCC(smb_buffer_response)) { |
3017 | ses->serverOS = kcalloc(1, len + 1,GFP_KERNEL); | 3017 | ses->serverOS = kzalloc(len + 1,GFP_KERNEL); |
3018 | strncpy(ses->serverOS,bcc_ptr, len); | 3018 | strncpy(ses->serverOS,bcc_ptr, len); |
3019 | 3019 | ||
3020 | bcc_ptr += len; | 3020 | bcc_ptr += len; |
@@ -3022,14 +3022,14 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3022 | bcc_ptr++; | 3022 | bcc_ptr++; |
3023 | 3023 | ||
3024 | len = strnlen(bcc_ptr, 1024); | 3024 | len = strnlen(bcc_ptr, 1024); |
3025 | ses->serverNOS = kcalloc(1, len+1,GFP_KERNEL); | 3025 | ses->serverNOS = kzalloc(len+1,GFP_KERNEL); |
3026 | strncpy(ses->serverNOS, bcc_ptr, len); | 3026 | strncpy(ses->serverNOS, bcc_ptr, len); |
3027 | bcc_ptr += len; | 3027 | bcc_ptr += len; |
3028 | bcc_ptr[0] = 0; | 3028 | bcc_ptr[0] = 0; |
3029 | bcc_ptr++; | 3029 | bcc_ptr++; |
3030 | 3030 | ||
3031 | len = strnlen(bcc_ptr, 1024); | 3031 | len = strnlen(bcc_ptr, 1024); |
3032 | ses->serverDomain = kcalloc(1, len+1,GFP_KERNEL); | 3032 | ses->serverDomain = kzalloc(len+1,GFP_KERNEL); |
3033 | strncpy(ses->serverDomain, bcc_ptr, len); | 3033 | strncpy(ses->serverDomain, bcc_ptr, len); |
3034 | bcc_ptr += len; | 3034 | bcc_ptr += len; |
3035 | bcc_ptr[0] = 0; | 3035 | bcc_ptr[0] = 0; |
@@ -3141,7 +3141,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3141 | if(tcon->nativeFileSystem) | 3141 | if(tcon->nativeFileSystem) |
3142 | kfree(tcon->nativeFileSystem); | 3142 | kfree(tcon->nativeFileSystem); |
3143 | tcon->nativeFileSystem = | 3143 | tcon->nativeFileSystem = |
3144 | kcalloc(1, length + 2, GFP_KERNEL); | 3144 | kzalloc(length + 2, GFP_KERNEL); |
3145 | cifs_strfromUCS_le(tcon->nativeFileSystem, | 3145 | cifs_strfromUCS_le(tcon->nativeFileSystem, |
3146 | (wchar_t *) bcc_ptr, | 3146 | (wchar_t *) bcc_ptr, |
3147 | length, nls_codepage); | 3147 | length, nls_codepage); |
@@ -3159,7 +3159,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3159 | if(tcon->nativeFileSystem) | 3159 | if(tcon->nativeFileSystem) |
3160 | kfree(tcon->nativeFileSystem); | 3160 | kfree(tcon->nativeFileSystem); |
3161 | tcon->nativeFileSystem = | 3161 | tcon->nativeFileSystem = |
3162 | kcalloc(1, length + 1, GFP_KERNEL); | 3162 | kzalloc(length + 1, GFP_KERNEL); |
3163 | strncpy(tcon->nativeFileSystem, bcc_ptr, | 3163 | strncpy(tcon->nativeFileSystem, bcc_ptr, |
3164 | length); | 3164 | length); |
3165 | } | 3165 | } |