mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Rahul Rao <shreeramrahul94@gmail.com>
Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>,
	Mark Greer <mgreer@animalcreek.com>,
	Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: audio: do not use iterator after list loop
Date: Wed, 7 Oct 2026 11:42:25 +0200	[thread overview]
Message-ID: <asYUAdQs0dwvi2nT@hovoldconsulting.com> (raw)
In-Reply-To: <20261007091104.15366-1-shreeramrahul94@gmail.com>

On Wed, Oct 07, 2026 at 02:41:04PM +0530, Rahul Rao wrote:
> Using the list iterator variable outside the loop breaks iterator scope
> semantics and can result in invalid memory access if the loop completes
> without finding a match.

No, it cannot. I rejected another patch like this earlier this week:

	https://lore.kernel.org/all/asNhLGdigxSqU5Op@hovoldconsulting.com/

I assume this was something flagged by coccinelle here too, which you
should have mentioned in your commit message.

I don't know what the warning message looks like but the term
"potential" is key here. You still need to look at the code to determine
whether there is an actual issue or not.

Johan

      reply	other threads:[~2026-10-07  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07  9:11 Rahul Rao
2026-10-07  9:42 ` Johan Hovold [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=asYUAdQs0dwvi2nT@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mgreer@animalcreek.com \
    --cc=shreeramrahul94@gmail.com \
    --cc=vaibhav.sr@gmail.com \
    /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

all inboxes | Powered by JetHome®