Patchwork acpica: fwts_acpica: clear sa_mask fields

login
register
mail settings
Submitter Colin King
Date May 7, 2013, 7:21 a.m.
Message ID <1367911319-21302-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/242051/
State Accepted
Headers show

Comments

Colin King - May 7, 2013, 7:21 a.m.
From: Colin Ian King <colin.king@canonical.com>

Coverity CID #997325, Uninitialized scalar variable (UNINIT)

We should also clear the sa_mask fields.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpica/fwts_acpica.c | 1 +
 1 file changed, 1 insertion(+)
Alex Hung - May 8, 2013, 2:11 a.m.
On 05/07/2013 03:21 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997325, Uninitialized scalar variable (UNINIT)
>
> We should also clear the sa_mask fields.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpica/fwts_acpica.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index b9c8839..85ac735 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -585,6 +585,7 @@ ACPI_STATUS AcpiOsWaitSemaphore(ACPI_HANDLE handle, UINT32 Units, UINT16 Timeout
>   		 *  control to continue.  It is evil.
>   		 */
>   		sa.sa_handler = sem_alarm;
> +		sigemptyset(&sa.sa_mask);
>   		sa.sa_flags = 0;
>   		sigaction(SIGALRM, &sa, NULL);
>   		alarm(MAX_WAIT_TIMEOUT);
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - May 20, 2013, 7:24 a.m.
On Tue, May 7, 2013 at 3:21 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997325, Uninitialized scalar variable (UNINIT)
>
> We should also clear the sa_mask fields.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpica/fwts_acpica.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index b9c8839..85ac735 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -585,6 +585,7 @@ ACPI_STATUS AcpiOsWaitSemaphore(ACPI_HANDLE handle, UINT32 Units, UINT16 Timeout
>                  *  control to continue.  It is evil.
>                  */
>                 sa.sa_handler = sem_alarm;
> +               sigemptyset(&sa.sa_mask);
>                 sa.sa_flags = 0;
>                 sigaction(SIGALRM, &sa, NULL);
>                 alarm(MAX_WAIT_TIMEOUT);
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
index b9c8839..85ac735 100644
--- a/src/acpica/fwts_acpica.c
+++ b/src/acpica/fwts_acpica.c
@@ -585,6 +585,7 @@  ACPI_STATUS AcpiOsWaitSemaphore(ACPI_HANDLE handle, UINT32 Units, UINT16 Timeout
 		 *  control to continue.  It is evil.
 		 */
 		sa.sa_handler = sem_alarm;
+		sigemptyset(&sa.sa_mask);
 		sa.sa_flags = 0;
 		sigaction(SIGALRM, &sa, NULL);
 		alarm(MAX_WAIT_TIMEOUT);