summaryrefslogtreecommitdiff
path: root/drivers/acpi/cppc_acpi.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-12-27 16:35:44 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-12-27 16:35:44 +0100
commit3f0bb496ee41d0eb99d308768c9f8593cbd3eb9f (patch)
treec56b697a7e818e91974d951872781bfd9b3af5b5 /drivers/acpi/cppc_acpi.c
parentd7fbdc575b33c374ce88ccfe3ab364f7eb240f8a (diff)
parent9c33eef84e3110963d6f41d87d63bc40d716eb1f (diff)
Merge branches 'thermal-tools' and 'thermal-int340x'
Merge tmon fix and int340x driver improvement for 5.17-rc1. * thermal-tools: thermal: tools: tmon: remove unneeded local variable * thermal-int340x: thermal: int340x: Use struct_group() for memcpy() region
Diffstat (limited to 'drivers/acpi/cppc_acpi.c')
-rw-r--r--drivers/acpi/cppc_acpi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index a85c351589be..b62c87b8ce4a 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -998,7 +998,14 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
{
struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
- struct cpc_register_resource *reg = &cpc_desc->cpc_regs[reg_idx];
+ struct cpc_register_resource *reg;
+
+ if (!cpc_desc) {
+ pr_debug("No CPC descriptor for CPU:%d\n", cpunum);
+ return -ENODEV;
+ }
+
+ reg = &cpc_desc->cpc_regs[reg_idx];
if (CPC_IN_PCC(reg)) {
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);