diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-01-10 12:58:45 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-01-10 12:58:45 +0300 |
commit | 10674d97c4e266e8c50ce794d1c470c26228d52b (patch) | |
tree | aac74b3223788893b4fa15fc976f179caf2fe452 | |
parent | c936069fb59c008013affd5672f0f27db2e03005 (diff) | |
parent | 3aa3c5882e4fb2274448908aaed605a3ed7dd15d (diff) | |
download | linux-10674d97c4e266e8c50ce794d1c470c26228d52b.tar.xz |
Merge branch 'powercap'
* powercap:
powercap: intel_rapl: add NULL pointer check to rapl_mmio_cpu_online()
-rw-r--r-- | drivers/powercap/intel_rapl_common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index a67701ed93e8..2e5b6a6834da 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -1295,6 +1295,9 @@ struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv) struct cpuinfo_x86 *c = &cpu_data(cpu); int ret; + if (!rapl_defaults) + return ERR_PTR(-ENODEV); + rp = kzalloc(sizeof(struct rapl_package), GFP_KERNEL); if (!rp) return ERR_PTR(-ENOMEM); |