mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
mtd: Fixed breaking list in __mtd_del_partition.
commit2966daf7d2upstream. 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:46b5889cc2("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ff10cd7bb2
commit
a8a607b004
@@ -313,7 +313,7 @@ static int __mtd_del_partition(struct mtd_info *mtd)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
list_del(&child->part.node);
|
||||
list_del(&mtd->part.node);
|
||||
free_partition(mtd);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user