Skip to content

Commit 10674d9

Browse files
committed
Merge branch 'powercap'
* powercap: powercap: intel_rapl: add NULL pointer check to rapl_mmio_cpu_online()
2 parents c936069 + 3aa3c58 commit 10674d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/powercap/intel_rapl_common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,9 @@ struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv)
12951295
struct cpuinfo_x86 *c = &cpu_data(cpu);
12961296
int ret;
12971297

1298+
if (!rapl_defaults)
1299+
return ERR_PTR(-ENODEV);
1300+
12981301
rp = kzalloc(sizeof(struct rapl_package), GFP_KERNEL);
12991302
if (!rp)
13001303
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)