diff --git a/sys/compat/linuxkpi/common/src/linux_dmi.c b/sys/compat/linuxkpi/common/src/linux_dmi.c --- a/sys/compat/linuxkpi/common/src/linux_dmi.c +++ b/sys/compat/linuxkpi/common/src/linux_dmi.c @@ -77,20 +77,25 @@ static bool linux_dmi_matches(const struct dmi_system_id *dsi) { + enum dmi_field slot; int i; for (i = 0; i < nitems(dsi->matches); i++) { - if (dsi->matches[i].slot == DMI_NONE) + slot = dsi->matches[i].slot; + if (slot == DMI_NONE) break; + if (slot >= DMI_STRING_MAX || + dmi_data[slot] == NULL) + return (false); if (dsi->matches[i].exact_match) { - return (dmi_match(dsi->matches[i].slot, - dsi->matches[i].substr)); - } else { - return (strstr(dmi_data[dsi->matches[i].slot], - dsi->matches[i].substr) != NULL); + if (dmi_match(slot, dsi->matches[i].substr)) + continue; + } else if (strstr(dmi_data[slot], + dsi->matches[i].substr) != NULL) { + continue; } + return (false); } - return (true); } diff --git a/sys/sys/param.h b/sys/sys/param.h --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400059 +#define __FreeBSD_version 1400060 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,