ACK: [PATCH] lib: fwts_coreboot_cbmem: fix cbmem_console_addr check
ivanhu
ivan.hu at canonical.com
Thu Aug 16 09:07:35 UTC 2018
On 08/14/2018 09:22 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The check to see if parse_cbmem_ref returned non-zero should
> be checking the contents of cbmem_console_addr and not
> the pointer cbmem_console_addr. Add the missing *.
>
> Detected by CoverityScan, CID#1394471 ("Dereference before null check")
>
> Fixes: c9bf07f25d13 ("fwts_coreboot.c: add cbmem console parser")
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_coreboot_cbmem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_coreboot_cbmem.c b/src/lib/src/fwts_coreboot_cbmem.c
> index 52f83f47..4185338d 100644
> --- a/src/lib/src/fwts_coreboot_cbmem.c
> +++ b/src/lib/src/fwts_coreboot_cbmem.c
> @@ -152,7 +152,7 @@ static int parse_cbtable_entries(
> switch (lbr_p->tag) {
> case LB_TAG_CBMEM_CONSOLE: {
> *cbmem_console_addr = (off_t)parse_cbmem_ref((struct lb_cbmem_ref *) lbr_p).cbmem_addr;
> - if (cbmem_console_addr)
> + if (*cbmem_console_addr)
> return 0;
> continue;
> }
Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/361b904e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/361b904e/attachment.sig>
More information about the fwts-devel
mailing list