Patchwork acpi: s3power: free quirks and command resources

login
register
mail settings
Submitter Colin King
Date May 6, 2013, 11:05 p.m.
Message ID <1367881551-21121-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/241818/
State Accepted
Headers show

Comments

Colin King - May 6, 2013, 11:05 p.m.
From: Colin Ian King <colin.king@canonical.com>

Coverity CID #997323, Unsed pointer value

Remove str assignment as this is redundant.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/s3power/s3power.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Alex Hung - May 9, 2013, 6:14 a.m.
On 05/07/2013 07:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997323, Unsed pointer value
>
> Remove str assignment as this is redundant.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/s3power/s3power.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index d65d872..6c6213a 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -74,8 +74,7 @@ static int s3power_wait_for_adapter_offline(fwts_framework *fw, bool *offline)
>
>   	for (i=0; (i<=20) && !*offline ;i++) {
>   		if ((buffer = fwts_acpi_event_read(fd, &len, 1)) != NULL) {
> -			char *str;
> -			if ((str = strstr(buffer, "ac_adapter")) != NULL)
> +			if (strstr(buffer, "ac_adapter") != NULL)
>   				s3power_adapter_offline(fw, offline);
>   			free(buffer);
>   		}
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu - May 16, 2013, 3:16 a.m.
On 05/07/2013 07:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997323, Unsed pointer value
>
> Remove str assignment as this is redundant.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/s3power/s3power.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index d65d872..6c6213a 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -74,8 +74,7 @@ static int s3power_wait_for_adapter_offline(fwts_framework *fw, bool *offline)
>
>   	for (i=0; (i<=20) && !*offline ;i++) {
>   		if ((buffer = fwts_acpi_event_read(fd, &len, 1)) != NULL) {
> -			char *str;
> -			if ((str = strstr(buffer, "ac_adapter")) != NULL)
> +			if (strstr(buffer, "ac_adapter") != NULL)
>   				s3power_adapter_offline(fw, offline);
>   			free(buffer);
>   		}
>

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

Patch

diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
index d65d872..6c6213a 100644
--- a/src/acpi/s3power/s3power.c
+++ b/src/acpi/s3power/s3power.c
@@ -74,8 +74,7 @@  static int s3power_wait_for_adapter_offline(fwts_framework *fw, bool *offline)
 
 	for (i=0; (i<=20) && !*offline ;i++) {
 		if ((buffer = fwts_acpi_event_read(fd, &len, 1)) != NULL) {
-			char *str;
-			if ((str = strstr(buffer, "ac_adapter")) != NULL)
+			if (strstr(buffer, "ac_adapter") != NULL)
 				s3power_adapter_offline(fw, offline);
 			free(buffer);
 		}