]> git.baikalelectronics.ru Git - uboot.git/commit
console: Fix handling of NULL global_data
authorSimon Glass <sjg@chromium.org>
Tue, 12 Jun 2018 06:04:56 +0000 (00:04 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 18 Jun 2018 18:43:14 +0000 (14:43 -0400)
commit6dc8ea85d89186d7ab84c78d92783b22f6d8c1d2
tree64a372e1ba5a814387d03e25d311eabcdc269f98
parentd270e597cf9e9a780a7d5f276c04a4a4c1e6d16a
console: Fix handling of NULL global_data

Both putc() and puts() can be called before global_data is set up. Some of
the code paths don't handle this correctly. Add an explicit test before
any member is accessed.

Reported-by: Coverity (CID: 169030)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
common/console.c