Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-07-09 18:43:31 +0800
committerColy Li <colyli@suse.de>2018-07-09 18:43:45 +0800
commitf82bd7e05ced3ee02a19907d952e9987e99890af (patch)
tree4a7f75d4095d26b3a50f0039f15e169bd2c4d067
parentf1294cbef5fdca831c25c94a971aa06c7f1866a2 (diff)
mtd: partitions: remove sysfs files when deleting all master's
partitions (bsc#1099918). suse-commit: d19835c7bb485043141a98d5406c8013a787ac08
-rw-r--r--drivers/mtd/mtdpart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 29a14fc89770..a79f6bcc62d0 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -603,6 +603,8 @@ static int __mtd_del_partition(struct mtd_part *priv)
{
int err;
+ sysfs_remove_files(&priv->mtd.dev.kobj, mtd_partition_attrs);
+
err = del_mtd_device(&priv->mtd);
if (err)
return err;
@@ -643,8 +645,6 @@ int mtd_del_partition(struct mtd_info *master, int partno)
list_for_each_entry_safe(slave, next, &mtd_partitions, list)
if ((slave->master == master) &&
(slave->mtd.index == partno)) {
- sysfs_remove_files(&slave->mtd.dev.kobj,
- mtd_partition_attrs);
ret = __mtd_del_partition(slave);
break;
}