diff options
| author | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2018-01-29 11:51:57 +0200 |
|---|---|---|
| committer | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2018-01-29 11:51:57 +0200 |
| commit | 74c0167f8bcf02af8ff9f2677b2d85070ba7236d (patch) | |
| tree | 5a840e9abb2e49abd64180c48e6e77ce428b237c /include/linux/string.h | |
| parent | 5db47e37b38755c5e26e6b8fbc1a32ce73495940 (diff) | |
| parent | 559f17bec508548850654dd04525fd69d90f6d4e (diff) | |
Merge drm-next into drm-intel-next-queued
Pull 4.15 into drm-intel-next-queued for next feature pull.
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 410ecf17de3c..cfd83eb2f926 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -259,7 +259,10 @@ __FORTIFY_INLINE __kernel_size_t strlen(const char *p) { __kernel_size_t ret; size_t p_size = __builtin_object_size(p, 0); - if (p_size == (size_t)-1) + + /* Work around gcc excess stack consumption issue */ + if (p_size == (size_t)-1 || + (__builtin_constant_p(p[p_size - 1]) && p[p_size - 1] == '\0')) return __builtin_strlen(p); ret = strnlen(p, p_size); if (p_size <= ret) |
