cvs commit: src/sys/dev/acpica acpi_perf.c

Nate Lawson nate at root.org
Thu Apr 7 10:36:57 PDT 2005


John Baldwin wrote:
> jhb         2005-04-05 19:39:44 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/acpica       acpi_perf.c 
>   Log:
>   Don't free the _PSS buffer until after we check to see if we have no valid
>   states as otherwise we will try to free the buffer twice.
>   
>   Revision  Changes    Path
>   1.19      +2 -2      src/sys/dev/acpica/acpi_perf.c
> 
> 
> Index: src/sys/dev/acpica/acpi_perf.c
> diff -u src/sys/dev/acpica/acpi_perf.c:1.18 src/sys/dev/acpica/acpi_perf.c:1.19
> --- src/sys/dev/acpica/acpi_perf.c:1.18	Sun Mar 27 22:38:28 2005
> +++ src/sys/dev/acpica/acpi_perf.c	Tue Apr  5 19:39:44 2005
> @@ -298,12 +298,12 @@
>  
>  		count++;
>  	}
> -	AcpiOsFree(buf.Pointer);
> -	sc->px_count = count;
>  
>  	/* No valid Px state found. */
>  	if (count == 0)
>  		goto out;
> +	AcpiOsFree(buf.Pointer);
> +	sc->px_count = count;
>  
>  	/* Get the control and status registers (one of each). */
>  	buf.Pointer = NULL;

Well, thanks for fixing the free but the count change was incorrect.  We 
set it to the full package size and need to always reset it, even if the 
result will be 0.

-- 
Nate


More information about the cvs-src mailing list