hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default
[pandora-kernel.git] / drivers / char / random.c
index c244f0e..edf45ae 100644 (file)
@@ -954,8 +954,8 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
         * pool while mixing, and hash one final time.
         */
        sha_transform(hash.w, extract, workspace);
-       memset(extract, 0, sizeof(extract));
-       memset(workspace, 0, sizeof(workspace));
+       memzero_explicit(extract, sizeof(extract));
+       memzero_explicit(workspace, sizeof(workspace));
 
        /*
         * In case the hash function has some recognizable output
@@ -978,7 +978,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
        }
 
        memcpy(out, &hash, EXTRACT_SIZE);
-       memset(&hash, 0, sizeof(hash));
+       memzero_explicit(&hash, sizeof(hash));
 }
 
 static ssize_t extract_entropy(struct entropy_store *r, void *buf,
@@ -1010,7 +1010,7 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
        }
 
        /* Wipe data just returned from memory */
-       memset(tmp, 0, sizeof(tmp));
+       memzero_explicit(tmp, sizeof(tmp));
 
        return ret;
 }
@@ -1047,7 +1047,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
        }
 
        /* Wipe data just returned from memory */
-       memset(tmp, 0, sizeof(tmp));
+       memzero_explicit(tmp, sizeof(tmp));
 
        return ret;
 }