]> git.baikalelectronics.ru Git - uboot.git/commit
cmd: nvedit: env_get_f must check for env_get_char error codes
authorSimon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
Wed, 31 Jan 2018 06:56:48 +0000 (07:56 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 31 Jan 2018 23:45:10 +0000 (18:45 -0500)
commita627e6486d141cc80c52932f20af0f679afd49b5
treeb4b6f06e614e702c6283b2e57d4c7ea9128086e5
parente810701ece23c4132193a14473060b4700426138
cmd: nvedit: env_get_f must check for env_get_char error codes

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 <sgoldschmidt@de.pepperl-fuchs.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
cmd/nvedit.c