Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Rosen Penev and committed by
Miquel Raynal
b800359a e882626c

+1 -2
+1 -2
drivers/mtd/parsers/cmdlinepart.c
··· 50 50 51 51 struct cmdline_mtd_partition { 52 52 struct cmdline_mtd_partition *next; 53 - char *mtd_id; 54 53 int num_parts; 55 54 struct mtd_partition *parts; 55 + char mtd_id[]; 56 56 }; 57 57 58 58 /* mtdpart_setup() parses into here */ ··· 289 289 /* enter results */ 290 290 this_mtd->parts = parts; 291 291 this_mtd->num_parts = num_parts; 292 - this_mtd->mtd_id = (char*)(this_mtd + 1); 293 292 strscpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1); 294 293 295 294 /* link into chain */