Skip to content

Commit 9751a9e

Browse files
Javi Merinotorvalds
authored andcommitted
thermal: power_allocator: allocate with kcalloc what you free with kfree
Commit cf736ea ("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: cf736ea ("thermal: power_allocator: do not use devm* interfaces") Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5e7fec2 commit 9751a9e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/thermal/power_allocator.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ static int allocate_power(struct thermal_zone_device *tz,
258258
BUILD_BUG_ON(sizeof(*req_power) != sizeof(*granted_power));
259259
BUILD_BUG_ON(sizeof(*req_power) != sizeof(*extra_actor_power));
260260
BUILD_BUG_ON(sizeof(*req_power) != sizeof(*weighted_req_power));
261-
req_power = devm_kcalloc(&tz->device, num_actors * 5,
262-
sizeof(*req_power), GFP_KERNEL);
261+
req_power = kcalloc(num_actors * 5, sizeof(*req_power), GFP_KERNEL);
263262
if (!req_power) {
264263
ret = -ENOMEM;
265264
goto unlock;

0 commit comments

Comments
 (0)