devfreq: memlat: correct null pointer derference

alloc_attr() might return NULL on memory allocation
failure which would lead to NULL pointer
de-reference, fix it by adding NULL check.

Change-Id: Iec7fee76a29c85355142a8bb475e2416807debd5
Signed-off-by: Stephen Dickey <[email protected]>
This commit is contained in:
Stephen Dickey 2020-05-06 11:16:50 -07:00
commit f2ddf34094

View file

@ -366,6 +366,9 @@ static int memlat_hp_restart_events(unsigned int cpu, bool cpu_up)
unsigned int idx;
struct event_data *common_evs;
if (!attr)
return -ENOMEM;
if (!cpu_grp)
goto exit;