aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifs_unicode.c')
-rw-r--r--fs/cifs/cifs_unicode.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index 9986817532b1..7932e20555d2 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -371,14 +371,9 @@ cifs_strndup_from_utf16(const char *src, const int maxlen,
371 if (!dst) 371 if (!dst)
372 return NULL; 372 return NULL;
373 cifs_from_utf16(dst, (__le16 *) src, len, maxlen, codepage, 373 cifs_from_utf16(dst, (__le16 *) src, len, maxlen, codepage,
374 NO_MAP_UNI_RSVD); 374 NO_MAP_UNI_RSVD);
375 } else { 375 } else {
376 len = strnlen(src, maxlen); 376 dst = kstrndup(src, maxlen, GFP_KERNEL);
377 len++;
378 dst = kmalloc(len, GFP_KERNEL);
379 if (!dst)
380 return NULL;
381 strlcpy(dst, src, len);
382 } 377 }
383 378
384 return dst; 379 return dst;