All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: "Thomas Weißschuh" <thomas@weissschuh.net>,
	"Benson Leung" <bleung@chromium.org>,
	"Guenter Roeck" <groeck@chromium.org>,
	"Sebastian Reichel" <sre@kernel.org>,
	chrome-platform@lists.linux.dev, linux-pm@vger.kernel.org,
	llvm@lists.linux.dev, patches@lists.linux.dev
Subject: Re: [PATCH] power: supply: cros_charge-control: Avoid accessing attributes out of bounds
Date: Wed, 3 Jul 2024 05:59:39 +0000	[thread overview]
Message-ID: <ZoToy98A4lbcUFP-@google.com> (raw)
In-Reply-To: <20240702-cros_charge-control-fix-clang-array-bounds-warning-v1-1-ae04d995cd1d@kernel.org>

On Tue, Jul 02, 2024 at 07:48:48AM -0700, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
> 
>   drivers/power/supply/cros_charge-control.c:319:2: error: array index 3 is past the end of the array (that has type 'struct attribute *[3]') [-Werror,-Warray-bounds]
>     319 |         priv->attributes[_CROS_CHCTL_ATTR_COUNT] = NULL;
>         |         ^                ~~~~~~~~~~~~~~~~~~~~~~
>   drivers/power/supply/cros_charge-control.c:49:2: note: array 'attributes' declared here
>      49 |         struct attribute *attributes[_CROS_CHCTL_ATTR_COUNT];
>         |         ^
>   1 error generated.
>
> [...]

Applied to

    https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

Thanks!

[1/1] power: supply: cros_charge-control: Avoid accessing attributes out of bounds
      commit: c98f17fec35e46629272226a898ebb0a653ee270

      parent reply	other threads:[~2024-07-03  5:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02 14:48 [PATCH] power: supply: cros_charge-control: Avoid accessing attributes out of bounds Nathan Chancellor
2024-07-02 19:09 ` Thomas Weißschuh
2024-07-03  5:59 ` Tzung-Bi Shih [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=ZoToy98A4lbcUFP-@google.com \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=sre@kernel.org \
    --cc=thomas@weissschuh.net \
    /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.