mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
dmi updates for v6.10
* KCFI violation fix for dmi-id. * Stop decoding on broken (short) DMI table entry. * Print info about populated memory slots at boot. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEfKafRGDxvcQf0shYpVJrm7PNTmoFAmZLAu8ACgkQpVJrm7PN Tmp8Wg//XMaoayG186uacpSAo0o4CPuxHLLkj+k0fBR4RpS+E3NFDIJvwnfXGkun OSti2CgvAE4gyhccFFqJccrx/NqoOH7ruC6qdOZJbywdh+0LJEkBLQyB3do/kVwg drQS8yNo47VFW0PgpuDko82LY7S2WAnbMpwo67c2M5TfHcHNb0uff1I1q2tvPx37 CqCDfUForsS5JbyXIxz3VDxgGrb93ODQ8zopmFsM2VItFT74LM2b1j6p+DZeFqkv 1kpvJwzJSGbO/xyEaWU7h0ehIpy5bAVdT63UzQ8SnSxT3Og2SOWG0X3k9uyr0Wpt 3VvqGQSRTvnDE95myNyNl5AmQkxSdaQdeHXCA5WVpyw7FeYPo0JmbLKzhxxn0P2i t2qH+HMnt+wcq9rq8TZBwu8aWCfihB7W4AFkp7hidyZ8Byp62lYLWg01yaIU8DO1 Urkh7T5+JVjR1qGEm3jNmSy5mleNjHiRQvcuXpaYCBw5GkN2qUcoIMl4vI+fs373 Ul6uNHbAjq89DrDuSqmqs0jtZ2Ie48+wqmdfQ9++uV7cD3C5LGgMlIkgqkUrGaSU 0btk9J7Flt6c3kTyYjVjvxli+Kk5Jb1huPCyu7mbbaL7ujDLM2E+szFMqBJ0Fwua ApPfOm19fuCAuTcSwGMxx8rg2voMpfEtc4BQZpjmfOeq84dJAJg= =088k -----END PGP SIGNATURE----- Merge tag 'dmi-for-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull dmi updates from Jean Delvare: "Bug fixes: - KCFI violation in dmi-id - stop decoding on broken (short) DMI table entry New features: - print info about populated memory slots at boot" * tag 'dmi-for-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: firmware: dmi: Add info message for number of populated and total memory slots firmware: dmi: Stop decoding on broken entry firmware: dmi-id: add a release callback function
This commit is contained in:
commit
80f9d90230
@ -169,9 +169,14 @@ static int dmi_dev_uevent(const struct device *dev, struct kobj_uevent_env *env)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dmi_dev_release(struct device *dev)
|
||||
{
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static struct class dmi_class = {
|
||||
.name = "dmi",
|
||||
.dev_release = (void(*)(struct device *)) kfree,
|
||||
.dev_release = dmi_dev_release,
|
||||
.dev_uevent = dmi_dev_uevent,
|
||||
};
|
||||
|
||||
|
@ -42,6 +42,7 @@ static struct dmi_memdev_info {
|
||||
u8 type; /* DDR2, DDR3, DDR4 etc */
|
||||
} *dmi_memdev;
|
||||
static int dmi_memdev_nr;
|
||||
static int dmi_memdev_populated_nr __initdata;
|
||||
|
||||
static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
|
||||
{
|
||||
@ -101,6 +102,17 @@ static void dmi_decode_table(u8 *buf,
|
||||
(data - buf + sizeof(struct dmi_header)) <= dmi_len) {
|
||||
const struct dmi_header *dm = (const struct dmi_header *)data;
|
||||
|
||||
/*
|
||||
* If a short entry is found (less than 4 bytes), not only it
|
||||
* is invalid, but we cannot reliably locate the next entry.
|
||||
*/
|
||||
if (dm->length < sizeof(struct dmi_header)) {
|
||||
pr_warn(FW_BUG
|
||||
"Corrupted DMI table, offset %zd (only %d entries processed)\n",
|
||||
data - buf, i);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* We want to know the total length (formatted area and
|
||||
* strings) before decoding to make sure we won't run off the
|
||||
@ -448,6 +460,9 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v)
|
||||
else
|
||||
bytes = (u64)get_unaligned((u32 *)&d[0x1C]) << 20;
|
||||
|
||||
if (bytes)
|
||||
dmi_memdev_populated_nr++;
|
||||
|
||||
dmi_memdev[nr].size = bytes;
|
||||
nr++;
|
||||
}
|
||||
@ -824,6 +839,8 @@ void __init dmi_setup(void)
|
||||
return;
|
||||
|
||||
dmi_memdev_walk();
|
||||
pr_info("DMI: Memory slots populated: %d/%d\n",
|
||||
dmi_memdev_populated_nr, dmi_memdev_nr);
|
||||
dump_stack_set_arch_desc("%s", dmi_ids_string);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user