* [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove
@ 2010-07-16 9:26 Axel Lin
2010-07-16 9:36 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2010-07-16 9:26 UTC (permalink / raw)
To: linux-kernel
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Margarita Olaya Cabrera, Jorge Eduardo Candelaria, alsa-devel
Memory allocation part:
We allocate a memory in twl6040_codec_probe():
priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
twl6040_codec = codec = &priv->codec;
Memory release part:
In twl6040_codec_remove() we should kfree(priv) instead of kfree(twl6040_codec).
In twl6040_remove(), no need and should not kfree(codec).
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
sound/soc/codecs/twl6040.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index af36346..9d4a85f 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1068,7 +1068,6 @@ static int twl6040_remove(struct platform_device *pdev)
twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF);
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
- kfree(codec);
return 0;
}
@@ -1214,7 +1213,7 @@ static int __devexit twl6040_codec_remove(struct platform_device *pdev)
snd_soc_unregister_dai(&twl6040_dai);
snd_soc_unregister_codec(twl6040_codec);
- kfree(twl6040_codec);
+ kfree(priv);
twl6040_codec = NULL;
return 0;
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove
2010-07-16 9:26 [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove Axel Lin
@ 2010-07-16 9:36 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-07-16 9:36 UTC (permalink / raw)
To: Axel Lin
Cc: Margarita Olaya Cabrera, Jorge Eduardo Candelaria, alsa-devel,
Takashi Iwai, linux-kernel, Liam Girdwood
On Fri, Jul 16, 2010 at 05:26:48PM +0800, Axel Lin wrote:
> Memory allocation part:
> We allocate a memory in twl6040_codec_probe():
> priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
> twl6040_codec = codec = &priv->codec;
Could you please try to take on board the feedback you were given
yesterday about this sort of stuff? Both the feedback about formatting
your patch so it's easy to apply and the collisions with other, more
substantial, work that's going on?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove
@ 2010-07-16 9:36 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-07-16 9:36 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Margarita Olaya Cabrera, Jorge Eduardo Candelaria, alsa-devel
On Fri, Jul 16, 2010 at 05:26:48PM +0800, Axel Lin wrote:
> Memory allocation part:
> We allocate a memory in twl6040_codec_probe():
> priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
> twl6040_codec = codec = &priv->codec;
Could you please try to take on board the feedback you were given
yesterday about this sort of stuff? Both the feedback about formatting
your patch so it's easy to apply and the collisions with other, more
substantial, work that's going on?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove
2010-07-16 9:36 ` Mark Brown
@ 2010-07-16 9:54 ` Axel Lin
-1 siblings, 0 replies; 5+ messages in thread
From: Axel Lin @ 2010-07-16 9:54 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Margarita Olaya Cabrera, Jorge Eduardo Candelaria, alsa-devel
hi Mark,
2010/7/16 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Fri, Jul 16, 2010 at 05:26:48PM +0800, Axel Lin wrote:
>> Memory allocation part:
>> We allocate a memory in twl6040_codec_probe():
>> priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
>> twl6040_codec = codec = &priv->codec;
>
> Could you please try to take on board the feedback you were given
> yesterday about this sort of stuff? Both the feedback about formatting
> your patch so it's easy to apply and the collisions with other, more
> substantial, work that's going on?
>
Ok. I will resend the patch.
( I just thought it may takes some time for review )
( Due a vacation this weekend, I'll do it next Monday )
Regards,
Axel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove
@ 2010-07-16 9:54 ` Axel Lin
0 siblings, 0 replies; 5+ messages in thread
From: Axel Lin @ 2010-07-16 9:54 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Margarita Olaya Cabrera, Jorge Eduardo Candelaria, alsa-devel
hi Mark,
2010/7/16 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Fri, Jul 16, 2010 at 05:26:48PM +0800, Axel Lin wrote:
>> Memory allocation part:
>> We allocate a memory in twl6040_codec_probe():
>> priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
>> twl6040_codec = codec = &priv->codec;
>
> Could you please try to take on board the feedback you were given
> yesterday about this sort of stuff? Both the feedback about formatting
> your patch so it's easy to apply and the collisions with other, more
> substantial, work that's going on?
>
Ok. I will resend the patch.
( I just thought it may takes some time for review )
( Due a vacation this weekend, I'll do it next Monday )
Regards,
Axel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-16 9:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 9:26 [PATCH] twl6040: fix wrong kfree in twl6040_remove and twl6040_codec_remove Axel Lin
2010-07-16 9:36 ` Mark Brown
2010-07-16 9:36 ` Mark Brown
2010-07-16 9:54 ` Axel Lin
2010-07-16 9:54 ` Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.