[U-Boot] [PATCH v10 02/10] lmb: fix allocation at end of address range

Simon Glass sjg at chromium.org
Wed Jan 16 21:34:23 UTC 2019


On Mon, 14 Jan 2019 at 14:38, Simon Goldschmidt
<simon.k.r.goldschmidt at gmail.com> wrote:
>
> The lmb code fails if base + size of RAM overflows to zero.
>
> Fix this by calculating end as 'base + size - 1' instead of 'base + size'
> where appropriate.
>
> Added tests to assert this is fixed.
>
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> ---
>
> Changes in v10: None
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> Changes in v6: None
> Changes in v5:
> - this patch is new in v5
>
> Changes in v4: None
> Changes in v2: None
>
>  lib/lmb.c      | 29 ++++++++++++-----------------
>  test/lib/lmb.c | 29 ++++++++++++++++++++++++++---
>  2 files changed, 38 insertions(+), 20 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list