summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/dt_cpu_ftrs.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2019-02-18 18:03:54 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2019-02-18 18:03:54 +1100
commit4fbf24a2c4cf796c5c9798942c8ffb70f2c46feb (patch)
tree8a98d272489a5c9bcb7fe7917be16e8db2733ff2 /arch/powerpc/kernel/dt_cpu_ftrs.c
parent521ffb22b5e3eefc5f4a44d540acf746d6233cde (diff)
parentf6ddb26d1da272ebfc386f2b6e9dc354f94117c0 (diff)
Merge branch 'akpm/master'
Diffstat (limited to 'arch/powerpc/kernel/dt_cpu_ftrs.c')
-rw-r--r--arch/powerpc/kernel/dt_cpu_ftrs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 8be3721d9302..af6814ae8b58 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -813,7 +813,6 @@ static int __init process_cpufeatures_node(unsigned long node,
int len;
f = &dt_cpu_features[i];
- memset(f, 0, sizeof(struct dt_cpu_feature));
f->node = node;
@@ -1008,7 +1007,12 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char
/* Count and allocate space for cpu features */
of_scan_flat_dt_subnodes(node, count_cpufeatures_subnodes,
&nr_dt_cpu_features);
- dt_cpu_features = __va(memblock_phys_alloc(sizeof(struct dt_cpu_feature) * nr_dt_cpu_features, PAGE_SIZE));
+ dt_cpu_features = memblock_alloc(sizeof(struct dt_cpu_feature) * nr_dt_cpu_features, PAGE_SIZE);
+ if (!dt_cpu_features)
+ panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
+ __func__,
+ sizeof(struct dt_cpu_feature) * nr_dt_cpu_features,
+ PAGE_SIZE);
cpufeatures_setup_start(isa);