soc/intel/common: Make read_pmc_lpm_requirements more clear
Commit 2eb100dd12
added PMC LPM requirements to the the PEP ACPI
objects, but it was not made clear that one of the pointer arguments to
the mentioned function is not supposed to be NULL and Coverity
complained. Make the intention clear by instead asserting that `info`
cannot be NULL.
Fixes: Coverity CID 1462119
Change-Id: I9e8862a100d92f4a7ed1826d3970a5110b47f4c4
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57645
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
d47946e750
commit
35730389ef
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <acpi/acpigen.h>
|
||||
#include <assert.h>
|
||||
#include <console/console.h>
|
||||
#include <intelblocks/acpi.h>
|
||||
#include <intelblocks/pmc_ipc.h>
|
||||
|
@ -27,6 +28,8 @@ struct reg_info {
|
|||
static void read_pmc_lpm_requirements(const struct soc_pmc_lpm *lpm,
|
||||
struct reg_info *info)
|
||||
{
|
||||
assert(info);
|
||||
|
||||
if (!CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_PEP_LPM_REQ) || !lpm) {
|
||||
memset(info, 0, sizeof(*info));
|
||||
return;
|
||||
|
@ -61,11 +64,9 @@ static void read_pmc_lpm_requirements(const struct soc_pmc_lpm *lpm,
|
|||
}
|
||||
}
|
||||
|
||||
if (info) {
|
||||
info->addr = (uint8_t *)reg;
|
||||
info->buffer_size = register_count * sizeof(uint32_t);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* For now there is only one disabled non-existent device, because Windows
|
||||
|
|
Loading…
Reference in New Issue