ACK: [PATCH] acpi: gpedump: ensure buf is set on default case

Alex Hung alex.hung at canonical.com
Tue Apr 7 18:09:59 UTC 2020


On 2020-04-07 11:25 a.m., Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> There is no default case in the switch statement and Coverity is
> complaining that buffer buf is not being initialized. Cater for this
> unlikely eventuality.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpi/gpedump/gpedump.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/acpi/gpedump/gpedump.c b/src/acpi/gpedump/gpedump.c
> index 38e03149..faf69bdf 100644
> --- a/src/acpi/gpedump/gpedump.c
> +++ b/src/acpi/gpedump/gpedump.c
> @@ -85,6 +85,9 @@ static void gpu_dump_gpes(
>  				n++;
>  			snprintf(buf, sizeof(buf), "notifies %" PRIu32 " devices", n);
>  			break;
> +		default:
> +			strncpy(buf, "unknown", sizeof(buf));
> +			break;
>  		}
>  		fwts_log_info_verbatim(fw, "      GPE 0x%2.2" PRIx8 ":",
>  			gpe_block_info->BlockBaseNumber + gpe);
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list