Skip to contentSkip to conversation

i2c: i2c_master_send(): don't leave flags uninitialized

PATCH Applied Antony Pavlov 2 participants 2 messages Feb 8, 2018 – Feb 9, 2018 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: i2c_master_send(): don't leave flags uninitialized

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

---
 drivers/i2c/i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/i2c.c +1 -0
index e9e7575585..608f8289bf 100644
@@ -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;
 
Signature · 7 lines
2.15.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Antony Pavlov

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

---
 drivers/i2c/i2c.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks

Sascha

Quoted 16 lines
drivers/i2c/i2c.c +1 -0
index e9e7575585..608f8289bf 100644
@@ -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;
 
Signature · 1 line
2.15.1
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox