summaryrefslogtreecommitdiff
path: root/lib/string.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-11-16 11:31:17 +0100
committerIngo Molnar <mingo@kernel.org>2014-11-16 11:31:17 +0100
commitf108c898ddae4bb1146ed9e46ce4470725d945c4 (patch)
treebb887907e0448d4d903f853c33b3c55a863412e2 /lib/string.c
parent904cb3677f3adcd3d837be0a0d0b14251ba8d6f7 (diff)
parent68055915c1c22489f9658bd2b7391bb11b2cf4e4 (diff)
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c16
1 files changed, 16 insertions, 0 deletions
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