mfd: Avoid writing uninitialized value to device
PATCH 1/1 mfd: Avoid writing uninitialized value to device
Avoid writing uninitialized value to device by explicitly initialize zero to 0.
Signed-off-by Axel Lin <[email protected]>
--- drivers/mfd/88pm860x-i2c.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/88pm860x-i2c.c +2 -2
@@ -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;
Signature · 1 line
1.7.5.4
Quoted 5 lines · Axel Lin
Avoid writing uninitialized value to device by explicitly initialize zero to 0.
Signed-off-by Axel Lin <[email protected]>---
Acked-by Haojian Zhuang <[email protected]>
Hi Axel,
Quoted 2 lines · Axel Lin
Avoid writing uninitialized value to device by explicitly initialize zero to 0.
88pm860x is now using the regmap API, so this patch is no longer relevant.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/