summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAndreas Oetken <ennoerlangen@gmail.com>2021-11-02 20:26:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 13:02:48 +0300
commit5794c37d2a98c2a6817a3da47c8b4defe47bf41e (patch)
treeff67e8842c332304bdfb8d96400b5ae0425ea7e9 /drivers/mtd
parentbb969ffe1d0e9faa6499326dea297be0450e6b5b (diff)
downloadlinux-5794c37d2a98c2a6817a3da47c8b4defe47bf41e.tar.xz
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/mtdpart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 04af12b66110..357661b62c94 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -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;