mirror of https://gitee.com/openkylin/linux.git
efi/libstub: Avoid returning uninitialized data from setup_graphics()
Currently, setup_graphics() ignores the return value of efi_setup_gop(). As AllocatePool() does not zero out memory, the screen information table will contain uninitialized data in this case. We should free the screen information table if efi_setup_gop() returns an error code. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Link: https://lore.kernel.org/r/20200426194946.112768-1-xypron.glpk@gmx.de Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
a088b858f1
commit
081d515084
|
@ -60,7 +60,11 @@ static struct screen_info *setup_graphics(void)
|
|||
si = alloc_screen_info();
|
||||
if (!si)
|
||||
return NULL;
|
||||
efi_setup_gop(si, &gop_proto, size);
|
||||
status = efi_setup_gop(si, &gop_proto, size);
|
||||
if (status != EFI_SUCCESS) {
|
||||
free_screen_info(si);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return si;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue