lkml.org 
[lkml]   [2013]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH linux-next] x86/mm: Fix compile warning in remove_pagetable()
From
On Tue, Feb 5, 2013 at 6:52 PM, Shuah Khan <shuah.khan@hp.com> wrote:
> Fix the following compile warning in remove_pagetable():
> arch/x86/mm/init_64.c: In function ‘remove_pagetable’:
> arch/x86/mm/init_64.c:996:9: warning: ‘next’ may be used uninitialized in this function [-Wuninitialized]
>
>
> Signed-off-by: Shuah Khan <shuah.khan@hp.com>
> ---
> arch/x86/mm/init_64.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 67bad4b..ed78400 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -987,7 +987,7 @@ remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end,
> static void __meminit
> remove_pagetable(unsigned long start, unsigned long end, bool direct)
> {
> - unsigned long next;
> + unsigned long next = pgd_addr_end(start, end);
> pgd_t *pgd;
> pud_t *pud;
> bool pgd_changed = false;
> --
> 1.7.9.5

Andrew already had one fix-fix-...-fix for that.



On Mon, Feb 4, 2013 at 3:28 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 4 Feb 2013 15:18:58 -0800
> Yinghai Lu <yinghai@kernel.org> wrote:
>
>> On Mon, Feb 4, 2013 at 3:04 PM, <akpm@linux-foundation.org> wrote:
>> >
>> > The patch titled
>> > Subject: memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix
>> > has been added to the -mm tree. Its filename is
>> > memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix.patch
>> >
>> > Before you just go and hit "reply", please:
>> > a) Consider who else should be cc'ed
>> > b) Prefer to cc a suitable mailing list as well
>> > c) Ideally: find the original patch on the mailing list and do a
>> > reply-to-all to that, adding suitable additional cc's
>> >
>> > *** Remember to use Documentation/SubmitChecklist when testing your code ***
>> >
>> > The -mm tree is included into linux-next and is updated
>> > there every 3-4 working days
>> >
>> > ------------------------------------------------------
>> > From: Andrew Morton <akpm@linux-foundation.org>
>> > Subject: memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix
>> >
>> > fix used-uninitialised bug
>> >
>> > Cc: Jiang Liu <jiang.liu@huawei.com>
>> > Cc: Jianguo Wu <wujianguo@huawei.com>
>> > Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> > Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
>> > Cc: Tang Chen <tangchen@cn.fujitsu.com>
>> > Cc: Wen Congyang <wency@cn.fujitsu.com>
>> > Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> > Cc: Yinghai Lu <yinghai@kernel.org>
>> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>> > ---
>> >
>> > arch/x86/mm/init_64.c | 4 ++--
>> > 1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff -puN arch/x86/mm/init_64.c~memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix arch/x86/mm/init_64.c
>> > --- a/arch/x86/mm/init_64.c~memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix
>>
>> it is hard to count fix now!
>
> Yes, I think that's a world record ;)
>
>> > +++ a/arch/x86/mm/init_64.c
>> > @@ -993,12 +993,12 @@ remove_pagetable(unsigned long start, un
>> > bool pgd_changed = false;
>> >
>> > for (; start < end; start = next) {
>> > + next = pgd_addr_end(start, end);
>> > +
>> > pgd = pgd_offset_k(start);
>> > if (!pgd_present(*pgd))
>> > continue;
>> >
>> > - next = pgd_addr_end(start, end);
>> > -
>> > pud = (pud_t *)pgd_page_vaddr(*pgd);
>> > remove_pud_table(pud, start, next, direct);
>> > if (free_pud_table(pud, pgd))
>> > _
>>
>> It's a real bug fix.
>> Without this fix, it will get dead loop if there is 512G (and aligned)
>> memory hole in the range.
>
> OK, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-02-06 06:01    [W:0.086 / U:4.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site