[PATCH] i2c: i2c_master_send(): don't leave flags uninitialized

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Leaving the flags field unitialized can lead to performing
read operation instead of write operation.

Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx>
---
 drivers/i2c/i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index e9e7575585..608f8289bf 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -117,6 +117,7 @@ int i2c_master_send(struct i2c_client *client, const char *buf, int count)
 	int ret;
 
 	msg.addr = client->addr;
+	msg.flags = 0;
 	msg.len = count;
 	msg.buf = (char *)buf;
 
-- 
2.15.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux