* [PATCH] mtd: cmdlinepart: use a flexible array member
@ 2026-03-17 0:35 Rosen Penev
2026-03-18 17:07 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-03-17 0:35 UTC (permalink / raw)
To: linux-mtd
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
open list:MEMORY TECHNOLOGY DEVICES (MTD), open list
This is already allocated properly. It's just using an extra pointer.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/mtd/parsers/cmdlinepart.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mtd/parsers/cmdlinepart.c b/drivers/mtd/parsers/cmdlinepart.c
index 60ab61493ffd..e79edf9931de 100644
--- a/drivers/mtd/parsers/cmdlinepart.c
+++ b/drivers/mtd/parsers/cmdlinepart.c
@@ -50,9 +50,9 @@
struct cmdline_mtd_partition {
struct cmdline_mtd_partition *next;
- char *mtd_id;
int num_parts;
struct mtd_partition *parts;
+ char mtd_id[];
};
/* mtdpart_setup() parses into here */
@@ -289,7 +289,6 @@ static int mtdpart_setup_real(char *s)
/* enter results */
this_mtd->parts = parts;
this_mtd->num_parts = num_parts;
- this_mtd->mtd_id = (char*)(this_mtd + 1);
strscpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1);
/* link into chain */
--
2.53.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-18 17:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 0:35 [PATCH] mtd: cmdlinepart: use a flexible array member Rosen Penev
2026-03-18 17:07 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox