qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] memory.c: bugfix - ref counting mismatch in memory_region_find
@ 2013-12-02 14:20 Marcel Apfelbaum
  2013-12-02 14:22 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Apfelbaum @ 2013-12-02 14:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, mst, jan.kiszka, anthony, pbonzini, rth

'address_space_get_flatview' gets a reference to a FlatView.
If the flatview lookup fails, the code returns without
"unreferencing" the view.

Cc: qemu-stable@nongnu.org

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
 memory.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/memory.c b/memory.c
index 28f6449..7764314 100644
--- a/memory.c
+++ b/memory.c
@@ -1596,6 +1596,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *mr,
     view = address_space_get_flatview(as);
     fr = flatview_lookup(view, range);
     if (!fr) {
+        flatview_unref(view);
         return ret;
     }
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] memory.c: bugfix - ref counting mismatch in memory_region_find
  2013-12-02 14:20 [Qemu-devel] [PATCH] memory.c: bugfix - ref counting mismatch in memory_region_find Marcel Apfelbaum
@ 2013-12-02 14:22 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2013-12-02 14:22 UTC (permalink / raw)
  To: Marcel Apfelbaum; +Cc: peter.maydell, mst, jan.kiszka, qemu-devel, anthony, rth

Il 02/12/2013 15:20, Marcel Apfelbaum ha scritto:
> 'address_space_get_flatview' gets a reference to a FlatView.
> If the flatview lookup fails, the code returns without
> "unreferencing" the view.
> 
> Cc: qemu-stable@nongnu.org
> 
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
>  memory.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/memory.c b/memory.c
> index 28f6449..7764314 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1596,6 +1596,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *mr,
>      view = address_space_get_flatview(as);
>      fr = flatview_lookup(view, range);
>      if (!fr) {
> +        flatview_unref(view);
>          return ret;
>      }
>  
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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

end of thread, other threads:[~2013-12-02 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 14:20 [Qemu-devel] [PATCH] memory.c: bugfix - ref counting mismatch in memory_region_find Marcel Apfelbaum
2013-12-02 14:22 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).