[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5422DA54.4020806@linaro.org>
Date: Wed, 24 Sep 2014 15:51:00 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Grant Likely <grant.likely@...aro.org>, devicetree@...r.kernel.org
CC: Rob Herring <robh+dt@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] of: fdt: fix memory range check
On 24/09/14 15:38, Grant Likely wrote:
>> --- a/drivers/of/fdt.c
>> >+++ b/drivers/of/fdt.c
>> >@@ -937,7 +937,7 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
>> > return;
>> > }
>> >
>> >- if (base + size > MAX_PHYS_ADDR) {
>> >+ if (base + size - 1 > MAX_PHYS_ADDR) {
>> > pr_warning("Ignoring memory range 0x%lx - 0x%llx\n",
>> > ULONG_MAX, base + size);
>> > size = MAX_PHYS_ADDR - base;
> By that logic, the above two lines need to be repaired also:
Thanks for fixing this too.
>
> pr_warning("Ignoring memory range 0x%lx - 0x%llx\n",
> MAX_PHYS_ADDR + 1, base + size);
I think the first argument should be printed in 0x%llx format as there
would be a 32bit overflow for MAX_PHYS_ADDR + 1.
> size = MAX_PHYS_ADDR - base + 1;
>
> I've fixed it up and applied, thanks.
--srini
--
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