From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] env_ubi.c: Correct pointer error in env load
Date: Mon, 26 Oct 2015 06:06:32 +0100 [thread overview]
Message-ID: <562DB4D8.3070805@denx.de> (raw)
In-Reply-To: <1445622690-18924-1-git-send-email-kevin.smith@elecsyscorp.com>
Hello Kevin,
Am 23.10.2015 um 19:51 schrieb Kevin Smith:
> The variable "buf" in this function is a char array, and the
> function ubi_volume_read is expecting a char *. In the call, the
> address of the pointer is being taken, incorrectly passing a
> char **. The compiler warning was being silenced by the cast.
> Remove the address operator and the cast.
>
> Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> common/env_ubi.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/common/env_ubi.c b/common/env_ubi.c
> index e0dc5af..e611199 100644
> --- a/common/env_ubi.c
> +++ b/common/env_ubi.c
> @@ -181,8 +181,7 @@ void env_relocate_spec(void)
> return;
> }
>
> - if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, (void *)&buf,
> - CONFIG_ENV_SIZE)) {
> + if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, buf, CONFIG_ENV_SIZE)) {
> printf("\n** Unable to read env from %s:%s **\n",
> CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME);
> set_default_env(NULL);
Good catch!
Reviewed-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
prev parent reply other threads:[~2015-10-26 5:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 17:51 [U-Boot] [PATCH] env_ubi.c: Correct pointer error in env load Kevin Smith
2015-10-23 20:30 ` Joe Hershberger
2015-10-26 5:06 ` Heiko Schocher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=562DB4D8.3070805@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox