ACK: [PATCH][V2] acpi: s3/s4: initialize error to zero

ivanhu ivan.hu at canonical.com
Wed Jul 24 06:43:03 UTC 2019



On 7/5/19 12:35 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Static analysis is warning that error is not initialized; it is
> actually set indirectly but lets be overly cautious and initialize
> it anyhow to squish the static analysis warnings.
> 
> Addresses-Coverity: ("Unintialized scalar variable")
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/acpi/s3/s3.c | 2 +-
>   src/acpi/s4/s4.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index c754af81..3a57825a 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -473,7 +473,7 @@ static int s3_check_log(
>   	int *suspend_too_long,
>   	int *resume_too_long)
>   {
> -	int error;
> +	int error = 0;
>   	int oops;
>   	int warn_on;
>   
> diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
> index 6de1dd91..34b6f7b5 100644
> --- a/src/acpi/s4/s4.c
> +++ b/src/acpi/s4/s4.c
> @@ -68,7 +68,7 @@ static int s4_init(fwts_framework *fw)
>   static void s4_check_log(fwts_framework *fw,
>   	fwts_list *klog, int *errors, int *oopses, int *warn_ons)
>   {
> -	int error;
> +	int error = 0;
>   	int oops;
>   	int warn_on;
>   
> 

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list