mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
efi_loader: error handling in read_console()
getc() might return an error code. Avoid an incorrect converison to Unicode. This addresses CoverityScan CID 184087. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:

committed by
Alexander Graf

parent
eee6530ed1
commit
60d7987656
@ -97,12 +97,17 @@ static u8 read_string(void *data)
|
|||||||
/**
|
/**
|
||||||
* read_console() - read byte from console
|
* read_console() - read byte from console
|
||||||
*
|
*
|
||||||
* @src - not used, needed to match interface
|
* @data - not used, needed to match interface
|
||||||
* Return: - byte read
|
* Return: - byte read or 0 on error
|
||||||
*/
|
*/
|
||||||
static u8 read_console(void *data)
|
static u8 read_console(void *data)
|
||||||
{
|
{
|
||||||
return getc();
|
int ch;
|
||||||
|
|
||||||
|
ch = getc();
|
||||||
|
if (ch < 0)
|
||||||
|
ch = 0;
|
||||||
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
int console_read_unicode(s32 *code)
|
int console_read_unicode(s32 *code)
|
||||||
|
Reference in New Issue
Block a user