From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Linux I2C <i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org>
Cc: David Brownell
<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [PATCH] i2c/tps65010: Add missing intialization of client data
Date: Sun, 27 Apr 2008 20:16:22 +0200 [thread overview]
Message-ID: <20080427201622.01649249@hyperion.delvare> (raw)
tps65010_remove() calls i2c_get_clientdata(client) but the client data
is never set during initialization, so it gets a NULL pointer at best.
I guess it was never spotted because the tps65010 driver is typically
not built modular so this function is discarded.
Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
drivers/i2c/chips/tps65010.c | 2 ++
1 file changed, 2 insertions(+)
--- linux-2.6.26-rc0.orig/drivers/i2c/chips/tps65010.c 2008-04-27 20:03:14.000000000 +0200
+++ linux-2.6.26-rc0/drivers/i2c/chips/tps65010.c 2008-04-27 20:05:23.000000000 +0200
@@ -527,6 +527,7 @@ static int __exit tps65010_remove(struct
flush_scheduled_work();
debugfs_remove(tps->file);
kfree(tps);
+ i2c_set_clientdata(client, NULL);
the_tps = NULL;
return 0;
}
@@ -616,6 +617,7 @@ static int tps65010_probe(struct i2c_cli
i2c_smbus_read_byte_data(client, TPS_DEFGPIO),
i2c_smbus_read_byte_data(client, TPS_MASK3));
+ i2c_set_clientdata(client, tps);
the_tps = tps;
#if defined(CONFIG_USB_GADGET) && !defined(CONFIG_USB_OTG)
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
reply other threads:[~2008-04-27 18:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080427201622.01649249@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.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