From: Wolfram Sang <w.sang@pengutronix.de>
To: linux-i2c@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Wolfram Sang <w.sang@pengutronix.de>,
Ryan Mallon <ryan@bluewatersys.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Anton Vorontsov <cbouatmailru@gmail.com>,
Jean Delvare <khali@linux-fr.org>
Subject: [PATCH] power/ds2782: fix clientdata on removal
Date: Thu, 1 Apr 2010 12:27:44 +0200 [thread overview]
Message-ID: <1270117664-29099-1-git-send-email-w.sang@pengutronix.de> (raw)
Probably due to a copy & paste bug, clientdata was set again to the data
structure (which is freed immediately afterwards) when it should be
NULLed. Just remove the calls as the i2c-core does this automatically
now.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>
---
Anton: If it is okay with you, I think this should go via the I2C-tree to
ensure it comes after the needed modification of the i2c-core.
drivers/power/ds2782_battery.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
index da14f37..305d463 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -236,8 +236,6 @@ static int ds2782_battery_remove(struct i2c_client *client)
idr_remove(&battery_id, info->id);
mutex_unlock(&battery_lock);
- i2c_set_clientdata(client, info);
-
kfree(info);
return 0;
}
@@ -289,7 +287,6 @@ static int ds2782_battery_probe(struct i2c_client *client,
fail_register:
kfree(info->battery.name);
fail_name:
- i2c_set_clientdata(client, info);
kfree(info);
fail_info:
mutex_lock(&battery_lock);
--
1.7.0
next reply other threads:[~2010-04-01 10:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 10:27 Wolfram Sang [this message]
2010-04-01 10:40 ` [PATCH] power/ds2782: fix clientdata on removal Anton Vorontsov
2010-04-04 14:13 ` Wolfram Sang
2010-04-06 16:50 ` Anton Vorontsov
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=1270117664-29099-1-git-send-email-w.sang@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=cbouatmailru@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=khali@linux-fr.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ryan@bluewatersys.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;
as well as URLs for NNTP newsgroup(s).