public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()
@ 2012-06-16 13:25 Axel Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Axel Lin @ 2012-06-16 13:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: Chanwoo Choi, Myungjoo Ham, Kyungmin Park, Greg Kroah-Hartman

extcon_dev_unregister(info->edev) doest not free info->edev, we need to call
kfree(info->edev) here.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/extcon/extcon-max8997.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 5ecf176..a4ed30b 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -514,6 +514,7 @@ static int __devexit max8997_muic_remove(struct platform_device *pdev)
 
 	extcon_dev_unregister(info->edev);
 
+	kfree(info->edev);
 	kfree(info);
 
 	return 0;
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()
@ 2012-06-18  2:42 함명주
  2012-06-18  2:54 ` Axel Lin
  0 siblings, 1 reply; 3+ messages in thread
From: 함명주 @ 2012-06-18  2:42 UTC (permalink / raw)
  To: Axel Lin, linux-kernel@vger.kernel.org
  Cc: 최찬우, 박경민,
	Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1838 bytes --]

> extcon_dev_unregister(info->edev) doest not free info->edev, we need to call
> kfree(info->edev) here.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

The patch is correct.

However, using devm_kzalloc at probe and removing kfree at remove appears to be much better.

Thank you.


Cheers!
MyungJoo.

> ---
>  drivers/extcon/extcon-max8997.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
> index 5ecf176..a4ed30b 100644
> --- a/drivers/extcon/extcon-max8997.c
> +++ b/drivers/extcon/extcon-max8997.c
> @@ -514,6 +514,7 @@ static int __devexit max8997_muic_remove(struct platform_device *pdev)
>  
>  	extcon_dev_unregister(info->edev);
>  
> +	kfree(info->edev);
>  	kfree(info);
>  
>  	return 0;
> -- 
> 1.7.9.5
> 
------
Sender : Axel Lin<axel.lin@gmail.com>
Date : 2012-06-16 22:25 (GMT+09:00)
Title : [PATCH] extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()

extcon_dev_unregister(info->edev) doest not free info->edev, we need to call
kfree(info->edev) here.

Signed-off-by: Axel Lin 
---
drivers/extcon/extcon-max8997.c |    1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 5ecf176..a4ed30b 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -514,6 +514,7 @@ static int __devexit max8997_muic_remove(struct platform_device *pdev)

extcon_dev_unregister(info->edev);

+ kfree(info->edev);
kfree(info);

return 0;
-- 
1.7.9.5






--
MyungJoo Ham (ÇÔ¸íÁÖ), PHD
System S/W Lab, S/W Platform Team, Software Center
Samsung Electronics
Cell: +82-10-6714-2858ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()
  2012-06-18  2:42 함명주
@ 2012-06-18  2:54 ` Axel Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Axel Lin @ 2012-06-18  2:54 UTC (permalink / raw)
  To: myungjoo.ham
  Cc: linux-kernel@vger.kernel.org, 최찬우,
	박경민, Greg Kroah-Hartman

2012/6/18 함명주 <myungjoo.ham@samsung.com>:
>> extcon_dev_unregister(info->edev) doest not free info->edev, we need to call
>> kfree(info->edev) here.
>>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> The patch is correct.
>
> However, using devm_kzalloc at probe and removing kfree at remove appears to be much better.
Yes, But I think Greg may prefer this one-linear for 3.5.
And another patch for the devm_kcalloc conversion for 3.6.

Regards,
Axel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-18  2:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-16 13:25 [PATCH] extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove() Axel Lin
  -- strict thread matches above, loose matches on Subject: below --
2012-06-18  2:42 함명주
2012-06-18  2:54 ` Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox