summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2018-02-08 10:31:45 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2018-02-09 09:31:34 +0100
commit2b3659b9648b26b485f13428bb3d3ccaf3517465 (patch)
treec51e7a986dc869af0ec4ab27d3ca97688596d6fb /drivers/i2c
parentbdf5be35d7b7d4b74de0e101e9b874d41235b157 (diff)
downloadbarebox-2b3659b9648b26b485f13428bb3d3ccaf3517465.tar.gz
barebox-2b3659b9648b26b485f13428bb3d3ccaf3517465.tar.xz
i2c: i2c_master_send(): don't leave flags uninitialized
Leaving the flags field unitialized can lead to performing read operation instead of write operation. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c.c1
1 files changed, 1 insertions, 0 deletions
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;