mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] i2c: i2c_master_send(): don't leave flags uninitialized
Date: Fri, 9 Feb 2018 09:31:49 +0100	[thread overview]
Message-ID: <20180209083149.luvp4odgc6rtxyqh@pengutronix.de> (raw)
In-Reply-To: <20180208073145.2644-1-antonynpavlov@gmail.com>

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

      reply	other threads:[~2018-02-09  8:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08  7:31 Antony Pavlov
2018-02-09  8:31 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209083149.luvp4odgc6rtxyqh@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox