All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Michael Tokarev <mjt@tls.msk.ru>, <qemu-devel@nongnu.org>
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com,
	peter.huangpeng@huawei.com, armbru@redhat.com
Subject: Re: [Qemu-trivial] [PATCH 2/9] arm: fix memory leak
Date: Thu, 5 Mar 2015 10:26:17 +0800	[thread overview]
Message-ID: <54F7BEC9.1060204@huawei.com> (raw)
In-Reply-To: <54F705B0.8040308@msgid.tls.msk.ru>

On 2015/3/4 21:16, Michael Tokarev wrote:
> 27.02.2015 10:50, arei.gonglei@huawei.com wrote:
> []
>> @@ -565,6 +565,7 @@ static void create_flash(const VirtBoardInfo *vbi)
>>              error_report("Could not load ROM image '%s'", bios_name);
>>              exit(1);
>>          }
>> +        g_free(fn);
>>      }
>>  
>>      create_one_flash("virt.flash0", flashbase, flashsize);
>>
> 
> This change introduces a compiler error:
> 
> hw/arm/virt.c: In function ‘create_flash’:
> hw/arm/virt.c:568:16: error: passing argument 1 of ‘g_free’ discards ‘const’ qualifier from pointer target type [-Werror]
>          g_free(fn);
>                 ^
> /usr/include/glib-2.0/glib/gmem.h:69:7: note: expected ‘gpointer’ but argument is of type ‘const char *’
>  void  g_free           (gpointer  mem);
>        ^
> 
> This is because just a few lines above, `fn' variable
> is declared as `const char *', which obviously should
> not be used with any *free() functions.
> 
Yes, and I found another similar problem in
 [PATCH 9/9] microblaze: fix memory leak
which you had pulled, maybe make sense wait a minuter.
Sorry for this.
> The solution is to remove `const' from the variable
> declaration.
> 
Correct.
> And a much more general solution is to actually test
> patches before submitting them.  You obviously did not
> test this series, having 3 errors in 9 patches, ie,
> 1/3 of your patches does not work...
> 
Apologize earnestly for troubling you. :(

I just thought they are so trivial, meanwhile I hadn't arm compiling environment (lack of
libfdt-dev), and assigned "--target-list=x86_64-softmmu" that moment.

Regards,
-Gonglei




WARNING: multiple messages have this Message-ID (diff)
From: Gonglei <arei.gonglei@huawei.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com,
	peter.huangpeng@huawei.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/9] arm: fix memory leak
Date: Thu, 5 Mar 2015 10:26:17 +0800	[thread overview]
Message-ID: <54F7BEC9.1060204@huawei.com> (raw)
In-Reply-To: <54F705B0.8040308@msgid.tls.msk.ru>

On 2015/3/4 21:16, Michael Tokarev wrote:
> 27.02.2015 10:50, arei.gonglei@huawei.com wrote:
> []
>> @@ -565,6 +565,7 @@ static void create_flash(const VirtBoardInfo *vbi)
>>              error_report("Could not load ROM image '%s'", bios_name);
>>              exit(1);
>>          }
>> +        g_free(fn);
>>      }
>>  
>>      create_one_flash("virt.flash0", flashbase, flashsize);
>>
> 
> This change introduces a compiler error:
> 
> hw/arm/virt.c: In function ‘create_flash’:
> hw/arm/virt.c:568:16: error: passing argument 1 of ‘g_free’ discards ‘const’ qualifier from pointer target type [-Werror]
>          g_free(fn);
>                 ^
> /usr/include/glib-2.0/glib/gmem.h:69:7: note: expected ‘gpointer’ but argument is of type ‘const char *’
>  void  g_free           (gpointer  mem);
>        ^
> 
> This is because just a few lines above, `fn' variable
> is declared as `const char *', which obviously should
> not be used with any *free() functions.
> 
Yes, and I found another similar problem in
 [PATCH 9/9] microblaze: fix memory leak
which you had pulled, maybe make sense wait a minuter.
Sorry for this.
> The solution is to remove `const' from the variable
> declaration.
> 
Correct.
> And a much more general solution is to actually test
> patches before submitting them.  You obviously did not
> test this series, having 3 errors in 9 patches, ie,
> 1/3 of your patches does not work...
> 
Apologize earnestly for troubling you. :(

I just thought they are so trivial, meanwhile I hadn't arm compiling environment (lack of
libfdt-dev), and assigned "--target-list=x86_64-softmmu" that moment.

Regards,
-Gonglei

  reply	other threads:[~2015-03-05  2:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27  7:50 [Qemu-trivial] [PATCH 0/9] Coverity defects fixes arei.gonglei
2015-02-27  7:50 ` [Qemu-devel] " arei.gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 1/9] nbd: fix resource leak arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 2/9] arm: fix memory leak arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-28  9:52   ` [Qemu-trivial] " Michael Tokarev
2015-02-28  9:52     ` [Qemu-devel] " Michael Tokarev
2015-02-28  9:59     ` [Qemu-trivial] " Gonglei
2015-02-28  9:59       ` [Qemu-devel] " Gonglei
2015-02-28 10:18       ` [Qemu-trivial] " Michael Tokarev
2015-02-28 10:18         ` [Qemu-devel] " Michael Tokarev
2015-02-28 10:21         ` Gonglei
2015-02-28 10:21           ` [Qemu-devel] " Gonglei
2015-03-04 13:16   ` Michael Tokarev
2015-03-04 13:16     ` [Qemu-devel] " Michael Tokarev
2015-03-05  2:26     ` Gonglei [this message]
2015-03-05  2:26       ` Gonglei
2015-03-05  8:47       ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
2015-03-05  8:47         ` [Qemu-devel] [Qemu-trivial] " Markus Armbruster
2015-03-05  9:43         ` [Qemu-trivial] [Qemu-devel] " Gonglei
2015-03-05  9:43           ` [Qemu-devel] [Qemu-trivial] " Gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 3/9] sparc/leon3.c: " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 4/9] macio: fix possible " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 5/9] e500: fix " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-28  9:41   ` [Qemu-trivial] " Michael Tokarev
2015-02-28  9:41     ` [Qemu-devel] " Michael Tokarev
2015-02-28  9:57     ` [Qemu-trivial] " Gonglei
2015-02-28  9:57       ` [Qemu-devel] " Gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 6/9] 9pfs: " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-28  9:46   ` [Qemu-trivial] " Michael Tokarev
2015-02-28  9:46     ` [Qemu-devel] " Michael Tokarev
2015-03-04 12:30   ` [Qemu-trivial] " Michael Tokarev
2015-03-04 12:30     ` [Qemu-devel] " Michael Tokarev
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 7/9] milkymist.c: " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 8/9] sysbus: " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-27  7:50 ` [Qemu-trivial] [PATCH 9/9] microblaze: " arei.gonglei
2015-02-27  7:50   ` [Qemu-devel] " arei.gonglei
2015-02-28  9:54 ` [Qemu-trivial] [PATCH 0/9] Coverity defects fixes Michael Tokarev
2015-02-28  9:54   ` [Qemu-devel] " Michael Tokarev
2015-02-28 10:03   ` [Qemu-trivial] " Gonglei
2015-02-28 10:03     ` [Qemu-devel] " 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=54F7BEC9.1060204@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.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.