Skip to content

Commit

Permalink
devfreq_cooling: return on allocation failure
Browse files Browse the repository at this point in the history
If the allocation fails then we can't continue.

Fixes: a76caf5 ('thermal: Add devfreq cooling')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Dan Carpenter authored and Eduardo Valentin committed Nov 4, 2015
1 parent 7e38a5b commit ce5ee16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/devfreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ static int devfreq_cooling_gen_tables(struct devfreq_cooling_device *dfc)
power_table = kcalloc(num_opps, sizeof(*power_table),
GFP_KERNEL);
if (!power_table)
ret = -ENOMEM;
return -ENOMEM;
}

freq_table = kcalloc(num_opps, sizeof(*freq_table),
Expand Down

0 comments on commit ce5ee16

Please sign in to comment.