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

mtd: Fixed breaking list in __mtd_del_partition.

Not the child partition should be removed from the partition list
but the partition itself. Otherwise the partition list gets broken
and any subsequent remove operations leads to a kernel panic.

Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling")
Signed-off-by: Andreas Oetken <andreas.oetken@siemens-energy.com>
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211102172604.2921065-1-andreas.oetken@siemens-energy.com

authored by

Andreas Oetken and committed by
Miquel Raynal
2966daf7 fa55b7dc

+1 -1
+1 -1
drivers/mtd/mtdpart.c
··· 312 312 if (err) 313 313 return err; 314 314 315 - list_del(&child->part.node); 315 + list_del(&mtd->part.node); 316 316 free_partition(mtd); 317 317 318 318 return 0;