cpufreq: powernv: fix missing check of return value in init_powernv_pstates()
authorYangtao Li <tiny.windzz@gmail.com>
Sat, 16 Feb 2019 17:06:23 +0000 (12:06 -0500)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 18 Feb 2019 04:57:38 +0000 (10:27 +0530)
commit5ae06c237fd05a1e9acf6f35891cfd85de792521
tree5dc3791fcfe79daf0c69a37fbf0eaa9c3b637568
parent2814335cb3c8b364dcc740b6317bd3297e81995c
cpufreq: powernv: fix missing check of return value in init_powernv_pstates()

kmalloc() could fail, so insert a check of its return value. And
if it fails, returns -ENOMEM.

And remove (struct pstate_idx_revmap_data *) to fix coccinelle WARNING
by the way.

WARNING: casting value returned by memory allocation function to (struct
pstate_idx_revmap_data *) is useless.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/powernv-cpufreq.c