From: Wanlong Gao <wanlong.gao@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: sameo@linux.intel.com, linux-input@vger.kernel.org,
Wanlong Gao <wanlong.gao@gmail.com>,
Wanlong Gao <gaowanlong@cn.fujitsu.com>
Subject: [PATCH] drivers:input:free the memory before set it to NULL
Date: Wed, 20 Jul 2011 23:41:36 +0800 [thread overview]
Message-ID: <1311176496-10026-1-git-send-email-wanlong.gao@gmail.com> (raw)
The memory of the platform driver data should be freed
before it was set to NULL.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
drivers/input/misc/pmic8xxx-pwrkey.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
index b3cfb9c..2f3ca73 100644
--- a/drivers/input/misc/pmic8xxx-pwrkey.c
+++ b/drivers/input/misc/pmic8xxx-pwrkey.c
@@ -198,8 +198,8 @@ static int __devexit pmic8xxx_pwrkey_remove(struct platform_device *pdev)
free_irq(key_press_irq, pwrkey);
free_irq(key_release_irq, pwrkey);
input_unregister_device(pwrkey->pwr);
- platform_set_drvdata(pdev, NULL);
kfree(pwrkey);
+ platform_set_drvdata(pdev, NULL);
return 0;
}
--
1.7.4.1
next reply other threads:[~2011-07-20 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 15:41 Wanlong Gao [this message]
2011-07-20 15:54 ` [PATCH] drivers:input:free the memory before set it to NULL Alan Cox
2011-07-20 16:08 ` Wanlong Gao
2011-07-20 16:11 ` Wanlong Gao
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=1311176496-10026-1-git-send-email-wanlong.gao@gmail.com \
--to=wanlong.gao@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gaowanlong@cn.fujitsu.com \
--cc=linux-input@vger.kernel.org \
--cc=sameo@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.