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

Alex Hung alex.hung at canonical.com
Thu Jul 4 17:42:40 UTC 2019


On 2019-07-04 10:35 a.m., 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: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list