From: 함명주 <myungjoo.ham@samsung.com>
To: Axel Lin <axel.lin@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: 최찬우 <cw00.choi@samsung.com>, 박경민 <kyungmin.park@samsung.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()
Date: Mon, 18 Jun 2012 02:42:52 +0000 (GMT) [thread overview]
Message-ID: <3920966.545511339987371711.JavaMail.weblogic@epml17> (raw)
[-- 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¥
next reply other threads:[~2012-06-18 2:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 2:42 함명주 [this message]
2012-06-18 2:54 ` [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-16 13:25 Axel Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3920966.545511339987371711.JavaMail.weblogic@epml17 \
--to=myungjoo.ham@samsung.com \
--cc=axel.lin@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox