From: Philipp Matthias Hahn <pmhahn@pmhahn.de>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-mtd@lists.infradead.org,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:KERNEL HARDENING (not covered by other
areas):Keyword:b__counted_by(_le|_be)?b"
<linux-hardening@vger.kernel.org>
Subject: Re: [PATCH 1/2] mtd: virt_concat: use single allocation for node
Date: Thu, 5 Mar 2026 08:08:46 +0100 [thread overview]
Message-ID: <aakr_hzORmNpme9Y@birdy.pmhahn.de> (raw)
In-Reply-To: <20260304221530.15018-2-rosenp@gmail.com>
Hello,
Am Wed, Mar 04, 2026 at 02:15:29PM -0800 schrieb Rosen Penev:
> Also add __counted_by attribute for extra runtime analysis.
…
> diff --git a/drivers/mtd/mtd_virt_concat.c b/drivers/mtd/mtd_virt_concat.c
> index aea88d1c9bc5..89e223edac6a 100644
> --- a/drivers/mtd/mtd_virt_concat.c
> +++ b/drivers/mtd/mtd_virt_concat.c
> @@ -31,8 +31,8 @@ static LIST_HEAD(concat_node_list);
> struct mtd_virt_concat_node {
> struct list_head head;
> unsigned int count;
> - struct device_node **nodes;
> struct mtd_concat *concat;
> + struct device_node *nodes[] __counted_by(nodes);
Looks wrong. Your follow-up patch does that:
- struct device_node *nodes[] __counted_by(nodes);
+ struct device_node *nodes[] __counted_by(count);
Philipp
next prev parent reply other threads:[~2026-03-05 7:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 22:15 [PATCH 0/2] mtd: concat: use flex array Rosen Penev
2026-03-04 22:15 ` [PATCH 1/2] mtd: virt_concat: use single allocation for node Rosen Penev
2026-03-05 7:08 ` Philipp Matthias Hahn [this message]
2026-03-05 8:52 ` Rosen Penev
2026-03-04 22:15 ` [PATCH 2/2] mtd: concat: replace alloc + calloc with 1 alloc Rosen Penev
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=aakr_hzORmNpme9Y@birdy.pmhahn.de \
--to=pmhahn@pmhahn.de \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=rosenp@gmail.com \
--cc=vigneshr@ti.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