From ce5ee1611284bef81d0308c6c2749902f55ed1d5 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 4 Nov 2015 16:36:20 +0300 Subject: [PATCH] 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 --- drivers/thermal/devfreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), -- 2.34.1