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

ivanhu ivan.hu at canonical.com
Wed Apr 8 06:43:31 UTC 2020



On 4/8/20 1:25 AM, 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: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list