From: Antti Palosaari <crope@iki.fi>
To: HoP <jpetrous@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] cxd2820r: fix possible out-of-array lookup
Date: Sat, 23 Jul 2011 01:37:18 +0300 [thread overview]
Message-ID: <4E29FB9E.4060507@iki.fi> (raw)
In-Reply-To: <CAJbz7-29H=e=C2SyY-6Ru23Zzv6sH7wBbOm72ZWMxqOagakuKQ@mail.gmail.com>
On 07/23/2011 01:18 AM, HoP wrote:
> In case of i2c write operation there is only one element in msg[] array.
> Don't access msg[1] in that case.
NACK.
I suspect you confuse now local msg2 and msg that is passed as function
parameter. Could you double check and explain?
regards
Antti
>
> Signed-off-by: Honza Petrous<jpetrous@smartimp.cz>
>
> --
>
> diff -uBbp cxd2820r_core.c.orig cxd2820r_core.c
> --- cxd2820r_core.c.orig 2011-07-22 23:31:56.319168405 +0200
> +++ cxd2820r_core.c 2011-07-22 23:35:02.508046078 +0200
> @@ -750,8 +750,6 @@ static int cxd2820r_tuner_i2c_xfer(struc
> }, {
> .addr = priv->cfg.i2c_address,
> .flags = I2C_M_RD,
> - .len = msg[1].len,
> - .buf = msg[1].buf,
> }
> };
>
> @@ -760,6 +758,8 @@ static int cxd2820r_tuner_i2c_xfer(struc
> if (num == 2) { /* I2C read */
> obuf[1] = (msg[0].addr<< 1) | I2C_M_RD; /* I2C RD flag */
> msg2[0].len = sizeof(obuf) - 1; /* maybe HW bug ? */
> + msg2[1].len = msg[1].len;
> + msg2[1].buf = msg[1].buf;
> }
> memcpy(&obuf[2], msg[0].buf, msg[0].len);
--
http://palosaari.fi/
next prev parent reply other threads:[~2011-07-22 22:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 22:18 [PATCH] cxd2820r: fix possible out-of-array lookup HoP
2011-07-22 22:37 ` Antti Palosaari [this message]
2011-07-22 22:47 ` HoP
2011-07-22 22:53 ` Antti Palosaari
2011-07-22 23:01 ` HoP
2011-07-22 23:31 ` Antti Palosaari
2011-07-22 23:36 ` Antti Palosaari
2011-07-22 23:47 ` HoP
2011-07-23 8:54 ` Malcolm Priestley
2011-07-23 15:10 ` HoP
2011-07-25 8:15 ` HoP
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=4E29FB9E.4060507@iki.fi \
--to=crope@iki.fi \
--cc=jpetrous@gmail.com \
--cc=linux-media@vger.kernel.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