mtd: Fixed breaking list in __mtd_del_partition.
authorAndreas Oetken <ennoerlangen@gmail.com>
Tue, 2 Nov 2021 17:26:04 +0000 (18:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:41 +0000 (10:53 +0100)
commita8a607b0049d8e5dc0c6b52e9c2b0490e0fc8716
tree6f10258074efb41941bb6c9da5fe49d814a5cd63
parentff10cd7bb295bfa9e497f83529479a04f356949f
mtd: Fixed breaking list in __mtd_del_partition.

commit 2966daf7d253d9904b337b040dd7a43472858b8a upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/mtdpart.c