From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] leds: pca9532: free after input_unregister_device()
Date: Fri, 12 Nov 2010 04:30:18 +0000 [thread overview]
Message-ID: <20101112043018.GB3644@bicker> (raw)
input_unregister_device() frees data->idev so the second
input_free_device() is a double free.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 43d0875..e1700cd 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -286,7 +286,6 @@ exit:
case PCA9532_TYPE_N2100_BEEP:
if (data->idev != NULL) {
input_unregister_device(data->idev);
- input_free_device(data->idev);
cancel_work_sync(&data->work);
data->idev = NULL;
}
@@ -341,7 +340,6 @@ static int pca9532_remove(struct i2c_client *client)
case PCA9532_TYPE_N2100_BEEP:
if (data->idev != NULL) {
input_unregister_device(data->idev);
- input_free_device(data->idev);
cancel_work_sync(&data->work);
data->idev = NULL;
}
next reply other threads:[~2010-11-12 4:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-12 4:30 Dan Carpenter [this message]
2010-11-12 5:21 ` [patch] leds: pca9532: free after input_unregister_device() Dmitry Torokhov
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=20101112043018.GB3644@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@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