Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1213222 > unrolled thread
| Started by | Javi Merino <javi.merino@arm.com> |
|---|---|
| First post | 2015-08-25 20:30 +0200 |
| Last post | 2015-08-29 20:00 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree Javi Merino <javi.merino@arm.com> - 2015-08-25 20:30 +0200
Re: [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree Javi Merino <javi.merino@arm.com> - 2015-08-27 17:50 +0200
Re: [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree Javi Merino <javi.merino@arm.com> - 2015-08-29 14:30 +0200
Re: [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-29 20:00 +0200
| From | Javi Merino <javi.merino@arm.com> |
|---|---|
| Date | 2015-08-25 20:30 +0200 |
| Subject | [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree |
| Message-ID | <q1r8R-68b-9@gated-at.bofh.it> |
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 <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>
---
Can this be merged for 4.2, please? I'm having memory problems with
4.2-rc8 because of this.
drivers/thermal/power_allocator.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c
index 7006860f2f36..251676902869 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;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Javi Merino <javi.merino@arm.com> |
|---|---|
| Date | 2015-08-27 17:50 +0200 |
| Subject | Re: [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree |
| Message-ID | <q27B8-lg-13@gated-at.bofh.it> |
| In reply to | #1213222 |
On Tue, Aug 25, 2015 at 07:22:35PM +0100, Javi Merino wrote:
> 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 <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>
> ---
>
> Can this be merged for 4.2, please? I'm having memory problems with
> 4.2-rc8 because of this.
Please merge this for 4.2 or revert cf736ea6f902 ("thermal:
power_allocator: do not use devm* interfaces")
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Javi Merino <javi.merino@arm.com> |
|---|---|
| Date | 2015-08-29 14:30 +0200 |
| Subject | Re: [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree |
| Message-ID | <q2NqG-1GH-11@gated-at.bofh.it> |
| In reply to | #1214664 |
Hi Linus,
On Thu, Aug 27, 2015 at 04:49:37PM +0100, Javi Merino wrote:
> On Tue, Aug 25, 2015 at 07:22:35PM +0100, Javi Merino wrote:
> > 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 <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>
> > ---
> >
> > Can this be merged for 4.2, please? I'm having memory problems with
> > 4.2-rc8 because of this.
>
> Please merge this for 4.2 or revert cf736ea6f902 ("thermal:
> power_allocator: do not use devm* interfaces")
cf736ea6f902 ("thermal: power_allocator: do not use devm*
interfaces") was merged for 4.2-rc8. It leaves an allocation of
memory with devm_kcalloc() that is then freed with kfree(). The
patch at the top of the thread[0][1] fixes this. Can you either
merge this patch or revert cf736ea6f902 for 4.2?
[0] https://patchwork.kernel.org/patch/7072591/
[1] Message-ID: <1440526955-9860-1-git-send-email-javi.merino@arm.com>
Thanks,
Javi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Date | 2015-08-29 20:00 +0200 |
| Subject | Re: [PATCH] thermal: power_allocator: allocate with kcalloc what you free with kfree |
| Message-ID | <q2SA2-zz-7@gated-at.bofh.it> |
| In reply to | #1215769 |
On Sat, Aug 29, 2015 at 5:27 AM, Javi Merino <javi.merino@arm.com> wrote:
>
> cf736ea6f902 ("thermal: power_allocator: do not use devm*
> interfaces") was merged for 4.2-rc8. It leaves an allocation of
> memory with devm_kcalloc() that is then freed with kfree(). The
> patch at the top of the thread[0][1] fixes this. Can you either
> merge this patch or revert cf736ea6f902 for 4.2?
Applied the patch. Thanks,
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web