From: Javi Merino Date: Tue, 25 Aug 2015 18:22:35 +0000 (+0100) Subject: thermal: power_allocator: allocate with kcalloc what you free with kfree X-Git-Tag: v4.2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9751a9e449da2a7749d89968039d532c615beeaa;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git thermal: power_allocator: allocate with kcalloc what you free with kfree Commit cf736ea6f902 ("thermal: power_allocator: do not use devm* interfaces") forgot to change a devm_kcalloc() to just kcalloc(), but it's corresponding devm_kfree() was changed to kfree(). Allocate with kcalloc() to match the kfree(). Fixes: cf736ea6f902 ("thermal: power_allocator: do not use devm* interfaces") Cc: Dmitry Torokhov Cc: Eduardo Valentin Cc: Zhang Rui Signed-off-by: Javi Merino Signed-off-by: Linus Torvalds --- diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index 7006860..2516769 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c @@ -258,8 +258,7 @@ static int allocate_power(struct thermal_zone_device *tz, BUILD_BUG_ON(sizeof(*req_power) != sizeof(*granted_power)); BUILD_BUG_ON(sizeof(*req_power) != sizeof(*extra_actor_power)); BUILD_BUG_ON(sizeof(*req_power) != sizeof(*weighted_req_power)); - req_power = devm_kcalloc(&tz->device, num_actors * 5, - sizeof(*req_power), GFP_KERNEL); + req_power = kcalloc(num_actors * 5, sizeof(*req_power), GFP_KERNEL); if (!req_power) { ret = -ENOMEM; goto unlock;