changeset 13613:8abd7b12d92f

1439 Panic when booting on IBM SystemX Reviewed by: Albert Lee <trisk@nexenta.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Richard Lowe <richlowe@richlowe.net>
author Jens Rosenboom <me@jayr.de>
date Sat, 18 Feb 2012 15:58:00 -0500
parents 96f1427cec2e
children 83e1e7dfbc8f
files usr/src/uts/intel/os/fmsmb.c
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/intel/os/fmsmb.c	Thu Feb 02 22:09:15 2012 +1100
+++ b/usr/src/uts/intel/os/fmsmb.c	Sat Feb 18 15:58:00 2012 -0500
@@ -559,7 +559,7 @@
 	oemstypes->type = SMB_TYPE_OEMSTR;
 	smb_strcnt(shp, oemstypes);
 
-	for (i = 0; i < oemstypes->count; i++) {
+	for (i = 0; i < oemstypes->count && compat == 0; i++) {
 		id = oemstypes->ids[i]->id;
 		cnt = smbios_info_strtab(shp, id, 0, NULL);
 		if (cnt > 0) {
@@ -570,26 +570,17 @@
 			for (j = 0; j < cnt; j++) {
 				if (strncmp(oem_strings[j], SMB_PRMS1,
 				    strlen(SMB_PRMS1) + 1) == 0) {
-					kmem_free(oem_strings,
-					    sizeof (char *) * cnt);
-					smb_free_strcnt(oemstypes, strcnt);
 					compat = 1;
 					break;
 				}
 			}
+			kmem_free(oem_strings, sizeof (char *) * cnt);
 		}
 	}
-
-	if (compat == 0) {
-		/* didn't find x86pi magic cookie */
-		if (oem_strings != NULL)
-			kmem_free(oem_strings, sizeof (char *) * cnt);
-		smb_free_strcnt(oemstypes, strcnt);
-		goto bad;
-	}
+	smb_free_strcnt(oemstypes, strcnt);
 
 	/* sanity check SMBIOS structures */
-	if (fm_smb_check(shp) == 0)
+	if ((compat != 0) && (fm_smb_check(shp) == 0))
 		return;
 
 bad: