lkml.org 
[lkml]   [2019]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpufreq: powernv: fix missing check of return value in init_powernv_pstates()
On Sat, Feb 16, 2019 at 12:06:23PM -0500, Yangtao Li wrote:
> 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>
> ---
> drivers/cpufreq/powernv-cpufreq.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
Looks good to me. Thanks for fixing this.

\
 
 \ /
  Last update: 2019-02-17 20:13    [W:0.037 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site