diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2022-01-16 03:54:58 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-03-27 16:16:07 +0100 |
commit | e86dfd0a44b8dece1bee04f34762888ce92732a4 (patch) | |
tree | 16b43e4817a5da3e86a08ab753cb5eaeb11c8b7e /target/linux/ipq806x/patches-5.15 | |
parent | 8cc2caed58e79ac24f9f5a075c6a12b07453c923 (diff) | |
download | upstream-e86dfd0a44b8dece1bee04f34762888ce92732a4.tar.gz upstream-e86dfd0a44b8dece1bee04f34762888ce92732a4.tar.bz2 upstream-e86dfd0a44b8dece1bee04f34762888ce92732a4.zip |
ipq806x: rework rootfs conflicts patch for smem
Now that smem actually free the leaked parts, when
a rootfs partition is detected, the kernel panics as
it try to free the static space allocated for the "ubi"
name. Change the logic and fix the name at the allocate_partition
function to correctly free the space allocated by smem.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-5.15')
-rw-r--r-- | target/linux/ipq806x/patches-5.15/102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/target/linux/ipq806x/patches-5.15/102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch b/target/linux/ipq806x/patches-5.15/102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch index e83872935f..5055261c4b 100644 --- a/target/linux/ipq806x/patches-5.15/102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch +++ b/target/linux/ipq806x/patches-5.15/102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch @@ -5,20 +5,21 @@ Subject: [PATCH 61/69] mtd: "rootfs" conflicts with OpenWrt auto mounting Signed-off-by: John Crispin <john@phrozen.org> --- - drivers/mtd/parsers/qcomsmempart.c | 4 ++++ + drivers/mtd/mtdpart.c | 4 ++++ 1 file changed, 4 insertions(+) ---- a/drivers/mtd/parsers/qcomsmempart.c -+++ b/drivers/mtd/parsers/qcomsmempart.c -@@ -132,6 +132,11 @@ static int parse_qcomsmem_part(struct mt - parts[i].offset = le32_to_cpu(pentry->offset) * mtd->erasesize; - parts[i].mask_flags = pentry->attr; - parts[i].size = le32_to_cpu(pentry->length) * mtd->erasesize; -+ -+ /* "rootfs" conflicts with OpenWrt auto mounting */ -+ if (mtd_type_is_nand(mtd) && !strcmp(name, "rootfs")) -+ parts[i].name = "ubi"; -+ - pr_debug("%d: %s offs=0x%08x size=0x%08x attr:0x%08x\n", - i, pentry->name, le32_to_cpu(pentry->offset), - le32_to_cpu(pentry->length), pentry->attr); +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -139,7 +139,11 @@ + + /* allocate the partition structure */ + child = kzalloc(sizeof(*child), GFP_KERNEL); ++ /* "rootfs" conflicts with OpenWrt auto mounting */ ++ if (mtd_type_is_nand(parent) && !strcmp(part->name, "rootfs")) ++ name = "ubi"; ++ else ++ name = kstrdup(part->name, GFP_KERNEL); +- name = kstrdup(part->name, GFP_KERNEL); + if (!name || !child) { + printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n", + parent->name); |