summaryrefslogtreecommitdiff
path: root/src/security/memory
diff options
context:
space:
mode:
Diffstat (limited to 'src/security/memory')
-rw-r--r--src/security/memory/memory_clear.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/security/memory/memory_clear.c b/src/security/memory/memory_clear.c
index 638c41a929..45bee91036 100644
--- a/src/security/memory/memory_clear.c
+++ b/src/security/memory/memory_clear.c
@@ -127,7 +127,8 @@ static void clear_memory(void *unused)
__func__, range_entry_base(r), range_entry_end(r));
/* Does regular memset work? */
- if (!(range_entry_end(r) >> sizeof(void *) * 8)) {
+ if (sizeof(resource_t) == sizeof(void *) ||
+ !(range_entry_end(r) >> (sizeof(void *) * 8))) {
/* fastpath */
memset((void *)(uintptr_t)range_entry_base(r), 0,
range_entry_size(r));