lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] xen/p2m: Check __brk_limit before allocating.
From
Date
On Tue, 2012-07-24 at 16:23 -0400, Konrad Rzeszutek Wilk wrote:
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 64effdc..b5bb26c 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -498,7 +498,14 @@ static bool alloc_p2m(unsigned long pfn)
>
> return true;
> }
> -
> +#include <asm/sections.h>
> +bool __init can_extend_brk()
> +{
> + /* Always reserve one for the DMI extend_brk call. */

That seems a bit fragile, what if someone adds something else or the
link order changes etc?

Can't we just have a variant of extend_brk which returns NULL instead of
BUG_ON and do error checking?

Or even just change extend_brk and push the BUG_ONs out to the callers
-- there aren't that many of them.

Ian.
--
Ian Campbell


Most people in this society who aren't actively mad are, at best,
reformed or potential lunatics.
-- Susan Sontag



\
 
 \ /
  Last update: 2012-07-26 10:41    [W:0.039 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site