extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()
함명주
maintainerQuoted 4 lines
extcon_dev_unregister(info->edev)doest not freeinfo->edev, we need to callkfree(info->edev)here.Signed-off-by Axel Lin <[email protected]>
The patch is correct.
However, using devm_kzalloc at probe and removing kfree at remove appears to be much better.
Thank you.
Cheers!
MyungJoo.
Quoted 19 lines
--- drivers/extcon/extcon-max8997.c | 1 + 1 file changed, 1 insertion(+)drivers/extcon/extcon-max8997.c +1
-0@@ -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 ;Signature · 1 line
1.7.9.5
------
Sender : Axel Lin<[email protected]>
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.
---drivers/extcon/extcon-max8997.c | 1 +
1 file changed, 1 insertion(+)
drivers/extcon/extcon-max8997.c +0 -0
@@ -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;
Signature · 12 lines
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�+돴윯돪�+%듚�깁負쪐w��{.n�+돴쪐{깸G쳺��{ay����,j�f"톒쉹��묎�z_溫(�쉸듶줷"얎�m����G쳺�◀?솳鈺�&x�~뤳턨O뺞촾퇉v�^�m����띠�◀?뻀�2012/6/18 함명주 <[email protected]>:
Quoted 8 lines
Quoted 4 lines
extcon_dev_unregister(info->edev)doest not freeinfo->edev, we need to callkfree(info->edev)here.Signed-off-by Axel Lin <[email protected]>The patch is correct.
However, using
devm_kzallocat 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