Skip to contentSkip to conversation

extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()

PATCH 함명주 2 participants 2 messages Jun 18, 2012 External connector subsystem (extcon)

lore
Share & tools
lore

함명주

author maintainer
#0 lore raw
Quoted 4 lines

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

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
index 5ecf176..a4ed30b 100644
@@ -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.

Signed-off-by Axel Lin

---
drivers/extcon/extcon-max8997.c | 1 +

1 file changed, 1 insertion(+)
drivers/extcon/extcon-max8997.c +0 -0
index 5ecf176..a4ed30b 100644
@@ -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����띠�◀?뻀�
#1 lore raw

2012/6/18 함명주 <[email protected]>:

Quoted 8 lines
Quoted 4 lines

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

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