acpi: s3/s4: initialize error to zero
diff mbox series

Message ID 20190704163301.12267-1-colin.king@canonical.com
State Superseded
Headers show
Series
  • acpi: s3/s4: initialize error to zero
Related show

Commit Message

Colin King July 4, 2019, 4:33 p.m. UTC
From: Colin Ian King <colin.king@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@canonical.com>
---
 src/acpi/s4/s4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin King July 4, 2019, 4:33 p.m. UTC | #1
On 04/07/2019 17:33, Colin King wrote:
> From: Colin Ian King <colin.king@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@canonical.com>
> ---
>  src/acpi/s4/s4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
>  
> 
NACK, I made a mistake. Sending V2.

Patch
diff mbox series

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;