All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	 arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] e500: fix memory leak
Date: Sat, 28 Feb 2015 17:47:56 +0100	[thread overview]
Message-ID: <54F1F13C.9070204@weilnetz.de> (raw)
In-Reply-To: <54F1EF7A.4040007@redhat.com>

Am 28.02.2015 um 17:40 schrieb Paolo Bonzini:
> On 28/02/2015 11:13, Michael Tokarev wrote:
>> 28.02.2015 13:08, arei.gonglei@huawei.com пишет:
>>> From: Gonglei <arei.gonglei@huawei.com>
>>>
>>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>>> ---
>>> v2: fix compilation complaint. (mjt)
>>> ---
>>>   hw/ppc/e500.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
>>> index 7e17d18..c060b50 100644
>>> --- a/hw/ppc/e500.c
>>> +++ b/hw/ppc/e500.c
>>> @@ -309,8 +309,10 @@ static int ppce500_load_device_tree(MachineState *machine,
>>>   
>>>           fdt = load_device_tree(filename, &fdt_size);
>>>           if (!fdt) {
>>> +            g_free(filename);
>>>               goto out;
>>>           }
>>> +        g_free(filename);
>>>           goto done;
>>>       }
>>
>> How about this?
>>
>> --- a/hw/ppc/e500.c
>> +++ b/hw/ppc/e500.c
>> @@ -308,6 +308,7 @@ static int ppce500_load_device_tree(MachineState *machine,
>>           }
>>
>>           fdt = load_device_tree(filename, &fdt_size);
>> +        g_free(filename);
>>           if (!fdt) {
>>               goto out;
>>           }
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Which one of the two patch variants did you review?

I suggest using Michael's version (only one g_free as early as 
possible). For that variant, my review may be added:

Reviewed-by: Stefan Weil <sw@weilnetz.de>



WARNING: multiple messages have this Message-ID (diff)
From: Stefan Weil <sw@weilnetz.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] e500: fix memory leak
Date: Sat, 28 Feb 2015 17:47:56 +0100	[thread overview]
Message-ID: <54F1F13C.9070204@weilnetz.de> (raw)
In-Reply-To: <54F1EF7A.4040007@redhat.com>

Am 28.02.2015 um 17:40 schrieb Paolo Bonzini:
> On 28/02/2015 11:13, Michael Tokarev wrote:
>> 28.02.2015 13:08, arei.gonglei@huawei.com пишет:
>>> From: Gonglei <arei.gonglei@huawei.com>
>>>
>>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>>> ---
>>> v2: fix compilation complaint. (mjt)
>>> ---
>>>   hw/ppc/e500.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
>>> index 7e17d18..c060b50 100644
>>> --- a/hw/ppc/e500.c
>>> +++ b/hw/ppc/e500.c
>>> @@ -309,8 +309,10 @@ static int ppce500_load_device_tree(MachineState *machine,
>>>   
>>>           fdt = load_device_tree(filename, &fdt_size);
>>>           if (!fdt) {
>>> +            g_free(filename);
>>>               goto out;
>>>           }
>>> +        g_free(filename);
>>>           goto done;
>>>       }
>>
>> How about this?
>>
>> --- a/hw/ppc/e500.c
>> +++ b/hw/ppc/e500.c
>> @@ -308,6 +308,7 @@ static int ppce500_load_device_tree(MachineState *machine,
>>           }
>>
>>           fdt = load_device_tree(filename, &fdt_size);
>> +        g_free(filename);
>>           if (!fdt) {
>>               goto out;
>>           }
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Which one of the two patch variants did you review?

I suggest using Michael's version (only one g_free as early as 
possible). For that variant, my review may be added:

Reviewed-by: Stefan Weil <sw@weilnetz.de>

  reply	other threads:[~2015-02-28 16:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 10:08 [Qemu-trivial] [PATCH v2] e500: fix memory leak arei.gonglei
2015-02-28 10:08 ` [Qemu-devel] " arei.gonglei
2015-02-28 10:13 ` [Qemu-trivial] " Michael Tokarev
2015-02-28 10:13   ` [Qemu-devel] " Michael Tokarev
2015-02-28 10:18   ` [Qemu-trivial] " Gonglei
2015-02-28 10:18     ` [Qemu-devel] " Gonglei
2015-02-28 10:47     ` [Qemu-trivial] " Michael Tokarev
2015-02-28 10:47       ` [Qemu-devel] " Michael Tokarev
2015-02-28 16:40   ` [Qemu-trivial] " Paolo Bonzini
2015-02-28 16:40     ` [Qemu-devel] " Paolo Bonzini
2015-02-28 16:47     ` Stefan Weil [this message]
2015-02-28 16:47       ` Stefan Weil
2015-03-01 10:06       ` [Qemu-trivial] " Paolo Bonzini
2015-03-01 10:06         ` [Qemu-devel] " Paolo Bonzini
2015-03-02  1:17         ` [Qemu-trivial] " Gonglei
2015-03-02  1:17           ` Gonglei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F1F13C.9070204@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=arei.gonglei@huawei.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.