All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: yujun <yujun@kylinos.cn>, Glenn Miles <milesg@linux.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/gpio/pca9552: fix off-by-one in QOM led index validation
Date: Mon, 29 Jun 2026 16:56:50 +0200	[thread overview]
Message-ID: <b2eb84d7-b74c-4edf-a4af-df92b4ea2032@oss.qualcomm.com> (raw)
In-Reply-To: <20260629074133.187549-1-yujun@kylinos.cn>

On 29/6/26 09:41, yujun wrote:
> pca955x_get_led() and pca955x_set_led() accept led indices equal to
> pin_count, but valid indices are 0..pin_count-1.  For a 16-pin device,
> led16 passes the current check and then accesses an LS register past
> max_reg.
> 
> Use the same >= pin_count bounds check as pca9554_set_pin() and the
> gpio input handler assert in this file.
> 
> Fixes: a90d8f84674 ("misc/pca9552: Add qom set and get")
> Signed-off-by: yujun <yujun@kylinos.cn>
> ---
>   hw/gpio/pca9552.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)


Queued via hw-misc, thanks!

Phil.


      parent reply	other threads:[~2026-06-29 14:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  7:41 [PATCH] hw/gpio/pca9552: fix off-by-one in QOM led index validation yujun
2026-06-29  9:39 ` Cédric Le Goater
2026-06-29  9:45 ` Peter Maydell
2026-06-29 14:34 ` Miles Glenn
2026-06-29 14:56 ` Philippe Mathieu-Daudé [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=b2eb84d7-b74c-4edf-a4af-df92b4ea2032@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=milesg@linux.ibm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=yujun@kylinos.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.