From 21a64e41815aee4850b73cc851ed5fcbeabae209 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 26 Jul 2008 20:27:45 +0000 Subject: [PATCH] fix kernel oops in the redboot partition parser when CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is set and there is some free space after the rootfs partition git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11948 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../generic-2.6/patches-2.6.23/070-redboot_space.patch | 6 +++--- .../generic-2.6/patches-2.6.24/070-redboot_space.patch | 6 +++--- .../generic-2.6/patches-2.6.25/070-redboot_space.patch | 6 +++--- .../generic-2.6/patches-2.6.26/070-redboot_space.patch | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/linux/generic-2.6/patches-2.6.23/070-redboot_space.patch b/target/linux/generic-2.6/patches-2.6.23/070-redboot_space.patch index 2f3155588..b4d57cb53 100644 --- a/target/linux/generic-2.6/patches-2.6.23/070-redboot_space.patch +++ b/target/linux/generic-2.6/patches-2.6.23/070-redboot_space.patch @@ -15,15 +15,15 @@ + parts[i].size = fl->next->img->flash_base; + parts[i].size &= ~(master->erasesize - 1); + parts[i].size -= parts[i].offset; -+ } +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED -+ else { ++ nrparts--; ++ } else { + i++; + parts[i].offset = parts[i-1].size + parts[i-1].offset; + parts[i].size = fl->next->img->flash_base - parts[i].offset; + parts[i].name = nullname; -+ } #endif ++ } + } tmp_fl = fl; fl = fl->next; diff --git a/target/linux/generic-2.6/patches-2.6.24/070-redboot_space.patch b/target/linux/generic-2.6/patches-2.6.24/070-redboot_space.patch index 2f3155588..b4d57cb53 100644 --- a/target/linux/generic-2.6/patches-2.6.24/070-redboot_space.patch +++ b/target/linux/generic-2.6/patches-2.6.24/070-redboot_space.patch @@ -15,15 +15,15 @@ + parts[i].size = fl->next->img->flash_base; + parts[i].size &= ~(master->erasesize - 1); + parts[i].size -= parts[i].offset; -+ } +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED -+ else { ++ nrparts--; ++ } else { + i++; + parts[i].offset = parts[i-1].size + parts[i-1].offset; + parts[i].size = fl->next->img->flash_base - parts[i].offset; + parts[i].name = nullname; -+ } #endif ++ } + } tmp_fl = fl; fl = fl->next; diff --git a/target/linux/generic-2.6/patches-2.6.25/070-redboot_space.patch b/target/linux/generic-2.6/patches-2.6.25/070-redboot_space.patch index b473d59ec..0f15bab3d 100644 --- a/target/linux/generic-2.6/patches-2.6.25/070-redboot_space.patch +++ b/target/linux/generic-2.6/patches-2.6.25/070-redboot_space.patch @@ -15,15 +15,15 @@ + parts[i].size = fl->next->img->flash_base; + parts[i].size &= ~(master->erasesize - 1); + parts[i].size -= parts[i].offset; -+ } +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED -+ else { ++ nrparts--; ++ } else { + i++; + parts[i].offset = parts[i-1].size + parts[i-1].offset; + parts[i].size = fl->next->img->flash_base - parts[i].offset; + parts[i].name = nullname; -+ } #endif ++ } + } tmp_fl = fl; fl = fl->next; diff --git a/target/linux/generic-2.6/patches-2.6.26/070-redboot_space.patch b/target/linux/generic-2.6/patches-2.6.26/070-redboot_space.patch index b473d59ec..0f15bab3d 100644 --- a/target/linux/generic-2.6/patches-2.6.26/070-redboot_space.patch +++ b/target/linux/generic-2.6/patches-2.6.26/070-redboot_space.patch @@ -15,15 +15,15 @@ + parts[i].size = fl->next->img->flash_base; + parts[i].size &= ~(master->erasesize - 1); + parts[i].size -= parts[i].offset; -+ } +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED -+ else { ++ nrparts--; ++ } else { + i++; + parts[i].offset = parts[i-1].size + parts[i-1].offset; + parts[i].size = fl->next->img->flash_base - parts[i].offset; + parts[i].name = nullname; -+ } #endif ++ } + } tmp_fl = fl; fl = fl->next; -- 2.35.1