Blame SOURCES/0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch

3540f1
From b535cf94fca7b3cda4905c26f6b5921e15abbc9f Mon Sep 17 00:00:00 2001
3540f1
From: Jean Delvare <jdelvare@suse.de>
3540f1
Date: Mon, 26 Aug 2019 14:20:15 +0200
3540f1
Subject: [PATCH 05/11] dmidecode: Only scan /dev/mem for entry point on x86
3540f1
3540f1
x86 is the only architecture which can have a DMI entry point scanned
3540f1
from /dev/mem. Do not attempt it on other architectures, because not
3540f1
only it can't work, but it can even cause the system to reboot.
3540f1
3540f1
This fixes support request #109697:
3540f1
https://savannah.nongnu.org/support/?109697
3540f1
3540f1
---
3540f1
 dmidecode.c | 8 +++++---
3540f1
 1 file changed, 5 insertions(+), 3 deletions(-)
3540f1
3540f1
diff --git a/dmidecode.c b/dmidecode.c
3540f1
index 21bfd65274c4..9c1e9c4b0498 100644
3540f1
--- a/dmidecode.c
3540f1
+++ b/dmidecode.c
3540f1
@@ -2,7 +2,7 @@
3540f1
  * DMI Decode
3540f1
  *
3540f1
  *   Copyright (C) 2000-2002 Alan Cox <alan@redhat.com>
3540f1
- *   Copyright (C) 2002-2018 Jean Delvare <jdelvare@suse.de>
3540f1
+ *   Copyright (C) 2002-2019 Jean Delvare <jdelvare@suse.de>
3540f1
  *
3540f1
  *   This program is free software; you can redistribute it and/or modify
3540f1
  *   it under the terms of the GNU General Public License as published by
3540f1
@@ -5538,7 +5538,7 @@ int main(int argc, char * const argv[])
3540f1
 	off_t fp;
3540f1
 	size_t size;
3540f1
 	int efi;
3540f1
-	u8 *buf;
3540f1
+	u8 *buf = NULL;
3540f1
 
3540f1
 	/*
3540f1
 	 * We don't want stdout and stderr to be mixed up if both are
3540f1
@@ -5642,7 +5642,7 @@ int main(int argc, char * const argv[])
3540f1
 			printf("Failed to get SMBIOS data from sysfs.\n");
3540f1
 	}
3540f1
 
3540f1
-	/* Next try EFI (ia64, Intel-based Mac) */
3540f1
+	/* Next try EFI (ia64, Intel-based Mac, arm64) */
3540f1
 	efi = address_from_efi(&fp);
3540f1
 	switch (efi)
3540f1
 	{
3540f1
@@ -5675,6 +5675,7 @@ int main(int argc, char * const argv[])
3540f1
 	goto done;
3540f1
 
3540f1
 memory_scan:
3540f1
+#if defined __i386__ || defined __x86_64__
3540f1
 	if (!(opt.flags & FLAG_QUIET))
3540f1
 		printf("Scanning %s for entry point.\n", opt.devmem);
3540f1
 	/* Fallback to memory scan (x86, x86_64) */
3540f1
@@ -5717,6 +5718,7 @@ int main(int argc, char * const argv[])
3540f1
 			}
3540f1
 		}
3540f1
 	}
3540f1
+#endif
3540f1
 
3540f1
 done:
3540f1
 	if (!found && !(opt.flags & FLAG_QUIET))
3540f1
-- 
3540f1
2.17.1
3540f1