From: Kevin Smith Date: Fri, 23 Oct 2015 17:51:47 +0000 (+0000) Subject: env_ubi.c: Correct pointer error in env load X-Git-Tag: v2016.01-rc2~245 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a7c06cd3a6c2c889bd115f43f3de0c9fcc066f96;p=u-boot env_ubi.c: Correct pointer error in env load 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 Cc: Joe Hershberger Cc: Tom Rini Acked-by: Joe Hershberger Reviewed-by: Heiko Schocher --- diff --git a/common/env_ubi.c b/common/env_ubi.c index e0dc5af851..e611199a58 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);