01 Feb, 2018

1 commit

  • env_get_f calls env_get_char to load single characters from the
    environment. However, the return value of env_get_char was not
    checked for errors. Now if the env driver does not support the
    .get_char call, env_get_f did not notice this and looped over the
    whole size of the environment, calling env_get_char over 8000
    times with the default settings, just to return an error in the
    end.

    Fix this by checking if env_get_char returns < 0.

    Signed-off-by: Simon Goldschmidt
    Acked-by: Maxime Ripard

    Simon Goldschmidt
     

27 Jan, 2018

1 commit

  • The nvedit command is the only user of env_driver_lookup_default outside of
    the environment code itself, and it uses it only to print the environment
    it's about to save to during env save.

    As we're about to rework the environment to be able to handle multiple
    environment sources, we might not have an idea of what environment backend
    is going to be used before trying (and possibly failing for some).

    Therefore, it makes sense to remove that message and move it to the
    env_save function itself. As a side effect, we also can get rid of the call
    to env_driver_lookup_default that is also about to get refactored.

    Reviewed-by: Andre Przywara
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     

16 Oct, 2017

1 commit


07 Oct, 2017

1 commit

  • The recent changes to these files did not completely fix the previous
    issues, or introduced different (minor) issues. In cmd/gpt.c we need to
    dereference str_disk_guid to be sure that malloc worked. In
    cmd/nvedit.c we need to be careful that we can also fit in that leading
    space when adding to the string. And in tools/fit_image.c we need to
    re-work the error handling slightly in fit_import_data() so that we only
    call munmap() once. We have two error paths here, one where we have an
    fd to close and one where we do not. Adjust labels to match this.

    Reported-by: Coverity (CID: 167366, 167367, 167370)
    Signed-off-by: Tom Rini

    Tom Rini
     

06 Oct, 2017

1 commit

  • When we have multiple messages provided, we need to be sure that we do
    not exceed the length of our 'message' buffer. In the for loop, make
    sure that pos is not larger than message. Only copy in at most however
    much of the message buffer remains. Finally, if we have not reached the
    end of the message buffer, put in a space and NULL, and if we have,
    ensure the buffer is now NULL termined.

    Reported-by: Coverity (CID: 165116)
    Signed-off-by: Tom Rini

    Tom Rini
     

04 Oct, 2017

1 commit

  • U-Boot widely uses error() as a bit noisier variant of printf().

    This macro causes name conflict with the following line in
    include/linux/compiler-gcc.h:

    # define __compiletime_error(message) __attribute__((error(message)))

    This prevents us from using __compiletime_error(), and makes it
    difficult to fully sync BUILD_BUG macros with Linux. (Notice
    Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

    Let's convert error() into now treewide-available pr_err().

    Done with the help of Coccinelle, excluing tools/ directory.

    The semantic patch I used is as follows:

    //
    @@@@
    -error
    +pr_err
    (...)
    //

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass
    [trini: Re-run Coccinelle]
    Signed-off-by: Tom Rini

    Masahiro Yamada
     

16 Aug, 2017

6 commits


12 Jun, 2017

1 commit


12 May, 2017

1 commit


07 Oct, 2016

1 commit


19 Apr, 2016

1 commit

  • Introduce env support for sata device.
    1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
    2. If want to enable this feature, define CONFIG_ENV_IS_IN_SATA, and
    define CONFIG_SYS_SATA_ENV_DEV or implement your own sata_get_ev_dev.

    Signed-off-by: Peng Fan
    Cc: Simon Glass
    Cc: Joe Hershberger
    Cc: Bin Meng
    Cc: Stefan Roese
    Cc: Heiko Schocher
    Cc: Stuart Longland
    Cc: Maxime Ripard
    Cc: Tom Rini
    Reviewed-by: Tom Rini

    Peng Fan
     

15 Mar, 2016

1 commit


25 Jan, 2016

1 commit

  • Now that they are in their own directory, we can remove this prefix.
    This makes it easier to find a file since the prefix does not get in the
    way.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Reviewed-by: Heiko Schocher
    Acked-by: Stefan Roese
    Acked-by: Przemyslaw Marczak

    Simon Glass