All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] libqtest: only call fclose() on open files
@ 2013-04-29 15:52 ` Jesse Larrew
  0 siblings, 0 replies; 6+ messages in thread
From: Jesse Larrew @ 2013-04-29 15:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, aliguori, Jesse Larrew

libqtest.c can segfault when calling fclose() if the pidfile wasn't
opened successfully. This patch fixes the issue.

Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
---
 tests/libqtest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 884f959..879ffe9 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
         if (fgets(buffer, sizeof(buffer), f)) {
             pid = atoi(buffer);
         }
+        fclose(f);
     }
-    fclose(f);
     return pid;
 }
 
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH] libqtest: only call fclose() on open files
@ 2013-04-29 15:52 ` Jesse Larrew
  0 siblings, 0 replies; 6+ messages in thread
From: Jesse Larrew @ 2013-04-29 15:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, aliguori, Jesse Larrew

libqtest.c can segfault when calling fclose() if the pidfile wasn't
opened successfully. This patch fixes the issue.

Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
---
 tests/libqtest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 884f959..879ffe9 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
         if (fgets(buffer, sizeof(buffer), f)) {
             pid = atoi(buffer);
         }
+        fclose(f);
     }
-    fclose(f);
     return pid;
 }
 
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-trivial] [Qemu-devel] [PATCH] libqtest: only call fclose() on open files
  2013-04-29 15:52 ` [Qemu-devel] " Jesse Larrew
@ 2013-04-30 14:51   ` Anthony Liguori
  -1 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2013-04-30 14:51 UTC (permalink / raw)
  To: Jesse Larrew, qemu-devel; +Cc: qemu-trivial, Jesse Larrew

Jesse Larrew <jlarrew@linux.vnet.ibm.com> writes:

> libqtest.c can segfault when calling fclose() if the pidfile wasn't
> opened successfully. This patch fixes the issue.
>
> Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>  tests/libqtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/libqtest.c b/tests/libqtest.c
> index 884f959..879ffe9 100644
> --- a/tests/libqtest.c
> +++ b/tests/libqtest.c
> @@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
>          if (fgets(buffer, sizeof(buffer), f)) {
>              pid = atoi(buffer);
>          }
> +        fclose(f);
>      }
> -    fclose(f);
>      return pid;
>  }
>  
> -- 
> 1.7.11.7



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] libqtest: only call fclose() on open files
@ 2013-04-30 14:51   ` Anthony Liguori
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2013-04-30 14:51 UTC (permalink / raw)
  To: Jesse Larrew, qemu-devel; +Cc: qemu-trivial

Jesse Larrew <jlarrew@linux.vnet.ibm.com> writes:

> libqtest.c can segfault when calling fclose() if the pidfile wasn't
> opened successfully. This patch fixes the issue.
>
> Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>  tests/libqtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/libqtest.c b/tests/libqtest.c
> index 884f959..879ffe9 100644
> --- a/tests/libqtest.c
> +++ b/tests/libqtest.c
> @@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
>          if (fgets(buffer, sizeof(buffer), f)) {
>              pid = atoi(buffer);
>          }
> +        fclose(f);
>      }
> -    fclose(f);
>      return pid;
>  }
>  
> -- 
> 1.7.11.7

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-trivial] [PATCH] libqtest: only call fclose() on open files
  2013-04-29 15:52 ` [Qemu-devel] " Jesse Larrew
@ 2013-05-02 15:55   ` Anthony Liguori
  -1 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2013-05-02 15:55 UTC (permalink / raw)
  To: Jesse Larrew, qemu-devel, Jesse Larrew
  Cc: qemu-trivial, aliguori, Jesse Larrew

Applied.  Thanks.

Regards,

Anthony Liguori



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] libqtest: only call fclose() on open files
@ 2013-05-02 15:55   ` Anthony Liguori
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2013-05-02 15:55 UTC (permalink / raw)
  To: Jesse Larrew, qemu-devel; +Cc: qemu-trivial, aliguori

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-02 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 15:52 [Qemu-trivial] [PATCH] libqtest: only call fclose() on open files Jesse Larrew
2013-04-29 15:52 ` [Qemu-devel] " Jesse Larrew
2013-04-30 14:51 ` [Qemu-trivial] " Anthony Liguori
2013-04-30 14:51   ` Anthony Liguori
2013-05-02 15:55 ` [Qemu-trivial] " Anthony Liguori
2013-05-02 15:55   ` [Qemu-devel] " Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.