mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c_master_send(): don't leave flags uninitialized
@ 2018-02-08  7:31 Antony Pavlov
  2018-02-09  8:31 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2018-02-08  7:31 UTC (permalink / raw)
  To: barebox

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

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: i2c_master_send(): don't leave flags uninitialized
  2018-02-08  7:31 [PATCH] i2c: i2c_master_send(): don't leave flags uninitialized Antony Pavlov
@ 2018-02-09  8:31 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-02-09  8:31 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Thu, Feb 08, 2018 at 10:31:45AM +0300, Antony Pavlov wrote:
> Leaving the flags field unitialized can lead to performing
> read operation instead of write operation.
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  drivers/i2c/i2c.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Applied, thanks

Sascha

> 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
> 
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-09  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08  7:31 [PATCH] i2c: i2c_master_send(): don't leave flags uninitialized Antony Pavlov
2018-02-09  8:31 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox