From: Dan Carpenter Date: Wed, 4 Nov 2015 13:36:20 +0000 (+0300) Subject: devfreq_cooling: return on allocation failure X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ce5ee1611284bef81d0308c6c2749902f55ed1d5;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git devfreq_cooling: return on allocation failure If the allocation fails then we can't continue. Fixes: a76caf55e5b3 ('thermal: Add devfreq cooling') Signed-off-by: Dan Carpenter Signed-off-by: Eduardo Valentin --- diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index d1b7c32e7406..01f0015f80dc 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -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),