[PATCH] mfd: Avoid writing uninitialized value to device

From: Axel Lin
Date: Thu Dec 08 2011 - 03:45:50 EST


Avoid writing uninitialized value to device by explicitly initialize
zero to 0.

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
---
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



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