From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: devicetree-discuss@lists.ozlabs.org,
kernel-janitors@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
lm-sensors@lm-sensors.org,
Grant Likely <grant.likely@secretlab.ca>
Subject: [patch] hwmon/max6697: fix memset size in max6697_init_chip()
Date: Tue, 15 Jan 2013 09:53:08 +0300 [thread overview]
Message-ID: <20130115065308.GA899@elgon.mountain> (raw)
sizeof(p) was intended instead of sizeof(data). data is a pointer and
p is a 7 character struct. It probably doesn't make a difference most
of the time, but it could result in using uninitialized data.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
index a1c8c0a..d229cc7 100644
--- a/drivers/hwmon/max6697.c
+++ b/drivers/hwmon/max6697.c
@@ -474,7 +474,7 @@ static int max6697_init_chip(struct i2c_client *client)
return 0;
if (!pdata || client->dev.of_node) {
- memset(&p, 0, sizeof(data));
+ memset(&p, 0, sizeof(p));
max6697_get_config_of(client->dev.of_node, &p);
pdata = &p;
}
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2013-01-15 6:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 6:53 Dan Carpenter [this message]
[not found] ` <20130115065308.GA899-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-01-15 10:54 ` [patch] hwmon/max6697: fix memset size in max6697_init_chip() Guenter Roeck
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=20130115065308.GA899@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=khali@linux-fr.org \
--cc=lm-sensors@lm-sensors.org \
--cc=rob.herring@calxeda.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).