[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080416193941.GB6264@joi>
Date: Wed, 16 Apr 2008 21:39:44 +0200
From: Marcin Slusarz <marcin.slusarz@...il.com>
To: Roel Kluin <12o3l@...cali.nl>
Cc: ralf@...ux-mips.org, linux-mips@...ux-mips.org,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/6] MIPS: irixelf: fix test unsigned var < 0
On Wed, Apr 16, 2008 at 03:39:22AM +0200, Roel Kluin wrote:
> v is unsigned, cast to signed to evaluate the do_brk() return value,
>
> Signed-off-by: Roel Kluin <12o3l@...cali.nl>
> ---
> diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
> index 290d8e3..fad2a2a 100644
> --- a/arch/mips/kernel/irixelf.c
> +++ b/arch/mips/kernel/irixelf.c
> @@ -583,15 +583,15 @@ static void irix_map_prda_page(void)
> unsigned long v;
> struct prda *pp;
>
> down_write(¤t->mm->mmap_sem);
> v = do_brk(PRDA_ADDRESS, PAGE_SIZE);
> up_write(¤t->mm->mmap_sem);
>
> - if (v < 0)
> + if ((long) v < 0)
maybe cast it earlier (to struct prda *) and check error with IS_ERR?
> return;
>
> pp = (struct prda *) v;
> pp->prda_sys.t_pid = task_pid_vnr(current);
> pp->prda_sys.t_prid = read_c0_prid();
> pp->prda_sys.t_rpid = task_pid_vnr(current);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists