aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.10/499-mtd-don-t-lock-when-recursively-deleting-partitions.patch
blob: 505131b6842acf8dbba8ca4383074a9ceb0d81f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: David Bauer <mail@david-bauer.net>
Date: Wed, 17 Feb 2021 03:21:39 +0100
Subject: [PATCH] mtd: don't lock when recursively deleting partitions

When recursively deleting partitions, don't acquire the masters
partition lock twice. Otherwise the process endy up in a deadlocked
state.

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 drivers/mtd/mtdpart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -474,7 +474,7 @@ static int __del_mtd_partitions(struct m
 
 	list_for_each_entry_safe(child, next, &mtd->partitions, part.node) {
 		if (mtd_has_partitions(child))
-			del_mtd_partitions(child);
+			__del_mtd_partitions(child);
 
 		pr_info("Deleting %s MTD partition\n", child->name);
 		ret = del_mtd_device(child);