From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>,
Samuel Ortiz <sameo@linux.intel.com>
Subject: [PATCH] mfd: Avoid writing uninitialized value to device
Date: Thu, 08 Dec 2011 16:45:20 +0800 [thread overview]
Message-ID: <1323333920.10774.1.camel@phoenix> (raw)
Avoid writing uninitialized value to device by explicitly initialize
zero to 0.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/mfd/88pm860x-i2c.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c
index e017dc8..fcde8a3 100644
--- a/drivers/mfd/88pm860x-i2c.c
+++ b/drivers/mfd/88pm860x-i2c.c
@@ -151,7 +151,7 @@ int pm860x_page_reg_write(struct i2c_client *i2c, int reg,
unsigned char data)
{
struct pm860x_chip *chip = i2c_get_clientdata(i2c);
- unsigned char zero;
+ unsigned char zero = 0;
int ret;
mutex_lock(&chip->io_lock);
@@ -208,7 +208,7 @@ int pm860x_page_set_bits(struct i2c_client *i2c, int reg,
unsigned char mask, unsigned char data)
{
struct pm860x_chip *chip = i2c_get_clientdata(i2c);
- unsigned char zero;
+ unsigned char zero = 0;
unsigned char value;
int ret;
--
1.7.5.4
next reply other threads:[~2011-12-08 8:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 8:45 Axel Lin [this message]
2011-12-09 2:26 ` [PATCH] mfd: Avoid writing uninitialized value to device Haojian Zhuang
2011-12-19 11:58 ` Samuel Ortiz
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=1323333920.10774.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=haojian.zhuang@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.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