public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: HoP <jpetrous@gmail.com>
Cc: Antti Palosaari <crope@iki.fi>, linux-media@vger.kernel.org
Subject: Re: [PATCH] cxd2820r: fix possible out-of-array lookup
Date: Sat, 23 Jul 2011 09:54:06 +0100	[thread overview]
Message-ID: <1311411246.2131.11.camel@localhost> (raw)
In-Reply-To: <CAJbz7-3-xGQOsk2CHq1pfyDoSLSKUo3ULt-7QAfuUfFBuiMt1g@mail.gmail.com>

On Sat, 2011-07-23 at 01:47 +0200, HoP wrote:
> 2011/7/23 Antti Palosaari <crope@iki.fi>:
> > On 07/23/2011 02:31 AM, Antti Palosaari wrote:
> >>
> >> On 07/23/2011 02:01 AM, HoP wrote:
> >>>
> >>> 2011/7/23 Antti Palosaari<crope@iki.fi>:
> >>>>
> >>>> But now I see what you mean. msg2[1] is set as garbage fields in case of
> >>>> incoming msg len is 1. True, but it does not harm since it is not
> >>>> used in
> >>>> that case.
> >>>
> >>> In case of write, cxd2820r_tuner_i2c_xfer() gets msg[] parameter
> >>> with only one element, true? If so, then my patch is correct.
> >>
> >> Yes it is true but nonsense. It is also wrong to make always msg2 as two
> >> element array too, but those are just simpler and generates most likely
> >> some code less. Could you see it can cause problem in some case?
> >
> > Now I thought it more, could it crash if it point out of memory area?
Arrays are not fussy they will read anything, just don't poke them :-)
> 
> I see you finally understood what I wanted to do :-)
> 
> I'm surprised that it not crashed already. I thought I have to missed something.

It does not crash because num is constant throughout, when the number of
messages is one the second element isn't transferred.


  reply	other threads:[~2011-07-23  8:54 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
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 [this message]
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=1311411246.2131.11.camel@localhost \
    --to=tvboxspy@gmail.com \
    --cc=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