diff options
| author | Rosen Penev <rosenp@gmail.com> | 2026-03-16 17:35:17 -0700 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2026-03-17 10:28:14 +0100 |
| commit | b800359a4dfacae983cd01f8c3f1cbb6f4c9f816 (patch) | |
| tree | 431aff559ab5e2fa1496d0c4994d56381b60e349 /drivers/mtd | |
| parent | e882626c1747653f1f01ea9d12e278e613b11d0f (diff) | |
mtd: cmdlinepart: use a flexible array member
This is already allocated properly. It's just using an extra pointer.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd')
| -rw-r--r-- | drivers/mtd/parsers/cmdlinepart.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/parsers/cmdlinepart.c b/drivers/mtd/parsers/cmdlinepart.c index 504e5fa2b45b..4caf1b3804f2 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 */ |
