aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2016-04-20 01:10:07 +0000
committerConrad Meyer <cem@FreeBSD.org>2016-04-20 01:10:07 +0000
commit3765b809934386dda7010960d5494fcb77dd0a8a (patch)
treeb9f8dea5a7f009cf635f4f619f02755f980ec635 /sys
parentfb4e4bd7f93133aa06a38b3fec97b1e163daed79 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/x86/acpica/srat.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/x86/acpica/srat.c b/sys/x86/acpica/srat.c
index 19ed116cb4cc..85f19221e707 100644
--- a/sys/x86/acpica/srat.c
+++ b/sys/x86/acpica/srat.c
@@ -355,17 +355,18 @@ renumber_domains(void)
if (j < ndomain && domain_pxm[j] == mem_info[i].domain)
continue;
+ if (ndomain >= MAXMEMDOM) {
+ ndomain = 1;
+ printf("SRAT: Too many memory domains\n");
+ return (EFBIG);
+ }
+
/* Insert the new domain at slot 'j'. */
slot = j;
for (j = ndomain; j > slot; j--)
domain_pxm[j] = domain_pxm[j - 1];
domain_pxm[slot] = mem_info[i].domain;
ndomain++;
- if (ndomain > MAXMEMDOM) {
- ndomain = 1;
- printf("SRAT: Too many memory domains\n");
- return (EFBIG);
- }
}
/* Renumber each domain to its index in the sorted 'domain_pxm' list. */