ACPI/nfit: avoid accessing uninitialized memory in acpi_nfit_ctl()
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 18 Nov 2020 07:35:17 +0000 (15:35 +0800)
committerDan Williams <dan.j.williams@intel.com>
Wed, 18 Nov 2020 19:46:18 +0000 (11:46 -0800)
commit1a57b1a3e11086a4f183b245754b213b1d9b2d40
tree94fbce75353fbba7b7c53fe3eea7333e03f53211
parent09162bc32c880a791c6c0668ce0745cf7958f576
ACPI/nfit: avoid accessing uninitialized memory in acpi_nfit_ctl()

The ACPI_ALLOCATE() does not zero the "buf", so when the condition
"integer->type != ACPI_TYPE_INTEGER" in int_to_buf() is met, the result
is unpredictable in acpi_nfit_ctl().

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/20201118073517.1884-1-thunder.leizhen@huawei.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/nfit/core.c