Commit 2966daf7 authored by Andreas Oetken's avatar Andreas Oetken Committed by Miquel Raynal

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: 46b5889c ("mtd: implement proper partition handling")
Signed-off-by: default avatarAndreas Oetken <andreas.oetken@siemens-energy.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211102172604.2921065-1-andreas.oetken@siemens-energy.com
parent fa55b7dc
......@@ -312,7 +312,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment