Project

General

Profile

Bug #1439 » sm.patch

Jens Rosenboom, 2011-09-05 07:05 PM

View differences:

usr/src/uts/intel/os/fmsmb.c Sat Sep 03 16:58:54 2011 -0400 → usr/src/uts/intel/os/fmsmb.c Mon Sep 05 21:02:42 2011 +0200
559 559
	oemstypes->type = SMB_TYPE_OEMSTR;
560 560
	smb_strcnt(shp, oemstypes);
561 561

  
562
	for (i = 0; i < oemstypes->count; i++) {
562
	for (i = 0; i < oemstypes->count; i++, compat == 0) {
563 563
		id = oemstypes->ids[i]->id;
564 564
		cnt = smbios_info_strtab(shp, id, 0, NULL);
565 565
		if (cnt > 0) {
......
570 570
			for (j = 0; j < cnt; j++) {
571 571
				if (strncmp(oem_strings[j], SMB_PRMS1,
572 572
				    strlen(SMB_PRMS1) + 1) == 0) {
573
					kmem_free(oem_strings,
574
					    sizeof (char *) * cnt);
575
					smb_free_strcnt(oemstypes, strcnt);
576 573
					compat = 1;
577 574
					break;
578 575
				}
579 576
			}
577
			kmem_free(oem_strings, sizeof (char *) * cnt);
580 578
		}
581 579
	}
582

  
583
	if (compat == 0) {
584
		/* didn't find x86pi magic cookie */
585
		if (oem_strings != NULL)
586
			kmem_free(oem_strings, sizeof (char *) * cnt);
587
		smb_free_strcnt(oemstypes, strcnt);
588
		goto bad;
589
	}
580
	smb_free_strcnt(oemstypes, strcnt);
590 581

  
591 582
	/* sanity check SMBIOS structures */
592
	if (fm_smb_check(shp) == 0)
583
	if (compat && fm_smb_check(shp) == 0)
593 584
		return;
594 585

  
595 586
bad:
(2-2/6)