lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu,  1 Apr 2010 12:27:44 +0200
From:	Wolfram Sang <w.sang@...gutronix.de>
To:	linux-i2c@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Wolfram Sang <w.sang@...gutronix.de>,
	Ryan Mallon <ryan@...ewatersys.com>,
	Hans Verkuil <hverkuil@...all.nl>,
	Anton Vorontsov <cbouatmailru@...il.com>,
	Jean Delvare <khali@...ux-fr.org>
Subject: [PATCH] power/ds2782: fix clientdata on removal

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@...gutronix.de>
Cc: Ryan Mallon <ryan@...ewatersys.com>
Cc: Hans Verkuil <hverkuil@...all.nl>
Cc: Anton Vorontsov <cbouatmailru@...il.com>
Cc: Jean Delvare <khali@...ux-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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ