From: Chen Gang <gang.chen@asianux.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
lrg@ti.com, broonie@opensource.wolfsonmicro.com,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Tony Lindgren <tony@atomide.com>
Subject: Fwd: [PATCH] drivers/regulator/twl-*: bettet set NUL after free
Date: Mon, 04 Feb 2013 10:55:54 +0800 [thread overview]
Message-ID: <510F233A.3020901@asianux.com> (raw)
In-Reply-To: <510F226E.4070401@asianux.com>
oh, sorry, not sent to mailing-list, originally.
(this patch should send to public kernel mailing list)
-------- 原始消息 --------
主题: [PATCH] drivers/regulator/twl-*: bettet set NUL after free
日期: Mon, 04 Feb 2013 10:52:30 +0800
发件人: Chen Gang <gang.chen@asianux.com>
收件人: lrg@ti.com, broonie@opensource.wolfsonmicro.com, Peter Ujfalusi <peter.ujfalusi@ti.com>, Tony Lindgren <tony@atomide.com>
in .remove function, better to set NUL after free, just like others.
in drivers/power/twl4030_charger.c, has already set NULL after free.
in drivers/input/keyboard/twl4030_keypad.c, has already set NUL after free.
additional info:
maybe this is not a bug, only for beautify code (can treat it as minor patch)
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
drivers/regulator/twl-regulator.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 74508cc..a9ab46a 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1247,6 +1247,7 @@ static int twlreg_remove(struct platform_device *pdev)
struct twlreg_info *info = rdev->reg_data;
regulator_unregister(rdev);
+ platform_set_drvdata(pdev, NULL);
kfree(info);
return 0;
}
--
1.7.7.6
parent reply other threads:[~2013-02-04 2:56 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <510F226E.4070401@asianux.com>]
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=510F233A.3020901@asianux.com \
--to=gang.chen@asianux.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=peter.ujfalusi@ti.com \
--cc=tony@atomide.com \
/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
all inboxes | Powered by JetHome®