diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2021-01-22 10:42:48 +0900 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-23 07:56:53 +0100 |
commit | 30f8222bb0016eef29afdd997bd1b3cdc486fdf9 (patch) | |
tree | d1c0e1fab126f3b6598853ed14ecae9cd9cd4ce7 /drivers/ddr/imx/imx8m/ddrphy_train.c | |
parent | 6e8c28cf523257acba5d6ccb4328253595640931 (diff) |
cmd: efidebug: always check return code from get_variable()
CID 316364 says:
> Null pointer dereferences (FORWARD_NULL)
> printf("Result total size: 0x%x\n", result->variable_total_size);
at do_efi_capsule_res().
The code is basically safe because a buffer for "result" is allocated
by malloc() and filled up by the second get_variable(), which fails any way
if the allocation has failed.
But the first (and second) get_variable() possibly returns an error other
than EFI_SUCCESS. We always need to check the return code from
get_variable() before accessing the data in "result".
While this change won't suppress CID 316364, the resulting code is much
safer.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'drivers/ddr/imx/imx8m/ddrphy_train.c')
0 files changed, 0 insertions, 0 deletions