diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
index 294e80b..e2ee506 100644
--- a/src/bios/mtrr/mtrr.c
+++ b/src/bios/mtrr/mtrr.c
@@ -249,9 +249,10 @@ static int validate_iomem(fwts_framework *fw)
 	FILE *file;
 	char buffer[4096];
 	int pcidepth = 0;
-	memset(buffer, 0, 4096);
 	int failed = 0;
 
+	memset(buffer, 0, 4096);
+
 	if ((file = fopen("/proc/iomem", "r")) == NULL)
 		return FWTS_ERROR;
 
