summaryrefslogtreecommitdiff
path: root/lib/string.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-11-26 23:39:02 +0300
committerMark Brown <broonie@kernel.org>2014-11-26 23:39:02 +0300
commit75ff9420448e7bb30ab8265463595e794ce0c3aa (patch)
treeea00f0cff2f6a272d60a518eb6dde6e14263b5b7 /lib/string.c
parent4524df83c7fc4f44702099a2db7b3cc938eb111f (diff)
parent206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff)
downloadlinux-75ff9420448e7bb30ab8265463595e794ce0c3aa.tar.xz
Merge tag 'v3.18-rc4' into regulator-max77686
Linux 3.18-rc4
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