]> git.baikalelectronics.ru Git - uboot.git/commit
serial: protect access to serial rx buffer
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 3 Aug 2018 11:38:43 +0000 (13:38 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 11 Sep 2018 00:20:34 +0000 (20:20 -0400)
commit676fdf20a3e5f1c25989ba9d3019ef79a5f429e9
tree38ccac62ceb5957d25a71707c3423b2fde263d9a
parent17280a6dc0b2707fd697de8b3fdfd4dcf4a0fa77
serial: protect access to serial rx buffer

Add test to avoid access to rx buffer when this buffer is empty.
In this case directly call getc() function to avoid issue when tstc()
is not called.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/serial-uclass.c