Skip to content

Commit b800359

Browse files
nehebmiquelraynal
authored andcommitted
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>
1 parent e882626 commit b800359

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/mtd/parsers/cmdlinepart.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050

5151
struct cmdline_mtd_partition {
5252
struct cmdline_mtd_partition *next;
53-
char *mtd_id;
5453
int num_parts;
5554
struct mtd_partition *parts;
55+
char mtd_id[];
5656
};
5757

5858
/* mtdpart_setup() parses into here */
@@ -289,7 +289,6 @@ static int mtdpart_setup_real(char *s)
289289
/* enter results */
290290
this_mtd->parts = parts;
291291
this_mtd->num_parts = num_parts;
292-
this_mtd->mtd_id = (char*)(this_mtd + 1);
293292
strscpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1);
294293

295294
/* link into chain */

0 commit comments

Comments
 (0)