X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=lib%2Fstring.c;h=10063300b83009dfcdc08988d640fc191481dde5;hb=a7ca10f263d7e673c74d8e0946d6b9993405cc9c;hp=2fc20aa06f848fcebd8aa30d238942f5ec399690;hpb=2d65a9f48fcdf7866aab6457bc707ca233e0c791;p=cascardo%2Flinux.git diff --git a/lib/string.c b/lib/string.c index 2fc20aa06f84..10063300b830 100644 --- a/lib/string.c +++ b/lib/string.c @@ -598,6 +598,22 @@ void *memset(void *s, int c, size_t count) EXPORT_SYMBOL(memset); #endif +/** + * memzero_explicit - Fill a region of memory (e.g. sensitive + * keying data) with 0s. + * @s: Pointer to the start of the area. + * @count: The size of the area. + * + * memzero_explicit() doesn't need an arch-specific version as + * it just invokes the one of memset() implicitly. + */ +void memzero_explicit(void *s, size_t count) +{ + memset(s, 0, count); + OPTIMIZER_HIDE_VAR(s); +} +EXPORT_SYMBOL(memzero_explicit); + #ifndef __HAVE_ARCH_MEMCPY /** * memcpy - Copy one area of memory to another