Patchwork acpi: Fix an infinite loop in acpi_table_add

login
register
mail settings
Submitter Vincent Minet
Date Oct. 5, 2010, 12:23 a.m.
Message ID <1286238192-7265-1-git-send-email-vincent@vincent-minet.net>
Download mbox | patch
Permalink /patch/66748/
State New
Headers show

Comments

Vincent Minet - Oct. 5, 2010, 12:23 a.m.
Commit d729bb9a7700e364b1c5f9893d61f07a9e002bce has a typo, causing an
infinite loop in acpi_table_add.

Signed-off-by: Vincent Minet <vincent@vincent-minet.net>
---
 hw/acpi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jes Sorensen - Oct. 7, 2010, 9:15 a.m.
On 10/05/10 02:23, Vincent Minet wrote:
> Commit d729bb9a7700e364b1c5f9893d61f07a9e002bce has a typo, causing an
> infinite loop in acpi_table_add.
> 
> Signed-off-by: Vincent Minet <vincent@vincent-minet.net>
> ---
>  hw/acpi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

OUCH!

Good catch!

Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>

Jes
Blue Swirl - Oct. 9, 2010, 9:42 a.m.
Thanks, applied.

On Tue, Oct 5, 2010 at 12:23 AM, Vincent Minet
<vincent@vincent-minet.net> wrote:
> Commit d729bb9a7700e364b1c5f9893d61f07a9e002bce has a typo, causing an
> infinite loop in acpi_table_add.
>
> Signed-off-by: Vincent Minet <vincent@vincent-minet.net>
> ---
>  hw/acpi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/acpi.c b/hw/acpi.c
> index 069e05f..8071e7b 100644
> --- a/hw/acpi.c
> +++ b/hw/acpi.c
> @@ -161,7 +161,7 @@ int acpi_table_add(const char *t)
>
>         /* off < length is necessary because file size can be changed
>            under our foot */
> -        while(s.st_size && off < length); {
> +        while(s.st_size && off < length) {
>             int r;
>             r = read(fd, p + off, s.st_size);
>             if (r > 0) {
> --
> 1.7.3.1
>
>
>

Patch

diff --git a/hw/acpi.c b/hw/acpi.c
index 069e05f..8071e7b 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -161,7 +161,7 @@  int acpi_table_add(const char *t)
 
         /* off < length is necessary because file size can be changed
            under our foot */
-        while(s.st_size && off < length); {
+        while(s.st_size && off < length) {
             int r;
             r = read(fd, p + off, s.st_size);
             if (r > 0) {