* [PATCH] hw/mips/boston: Initialize g_autofree pointers
@ 2022-06-05 15:19 Bernhard Beschow
2022-06-05 16:13 ` Richard Henderson
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Bernhard Beschow @ 2022-06-05 15:19 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Aleksandar Rikalo, Jiaxun Yang, Paul Burton,
Philippe Mathieu-Daudé, Bernhard Beschow
Fixes compilation due to false positives with -Werror:
In file included from /usr/include/glib-2.0/glib.h:114,
from qemu/src/include/glib-compat.h:32,
from qemu/src/include/qemu/osdep.h:144,
from ../src/hw/mips/boston.c:20:
In function ‘g_autoptr_cleanup_generic_gfree’,
inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_load_data’ may be used uninitialized [-Werror=maybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
../src/hw/mips/boston.c: In function ‘boston_mach_init’:
../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared here
790 | g_autofree const void *dtb_file_data, *dtb_load_data;
| ^~~~~~~~~~~~~
In function ‘g_autoptr_cleanup_generic_gfree’,
inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_file_data’ may be used uninitialized [-Werror=maybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
../src/hw/mips/boston.c: In function ‘boston_mach_init’:
../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared here
790 | g_autofree const void *dtb_file_data, *dtb_load_data;
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/mips/boston.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 59ca08b93a..1debca18ec 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -787,7 +787,8 @@ static void boston_mach_init(MachineState *machine)
if (kernel_size > 0) {
int dt_size;
- g_autofree const void *dtb_file_data, *dtb_load_data;
+ g_autofree const void *dtb_file_data = NULL;
+ g_autofree const void *dtb_load_data = NULL;
hwaddr dtb_paddr = QEMU_ALIGN_UP(kernel_high, 64 * KiB);
hwaddr dtb_vaddr = cpu_mips_phys_to_kseg0(NULL, dtb_paddr);
--
2.36.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers
2022-06-05 15:19 [PATCH] hw/mips/boston: Initialize g_autofree pointers Bernhard Beschow
@ 2022-06-05 16:13 ` Richard Henderson
2022-06-06 15:04 ` Philippe Mathieu-Daudé via
2022-06-10 14:04 ` Philippe Mathieu-Daudé via
2 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2022-06-05 16:13 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: qemu-trivial, Aleksandar Rikalo, Jiaxun Yang, Paul Burton,
Philippe Mathieu-Daudé
On 6/5/22 08:19, Bernhard Beschow wrote:
> Fixes compilation due to false positives with -Werror:
>
> In file included from /usr/include/glib-2.0/glib.h:114,
> from qemu/src/include/glib-compat.h:32,
> from qemu/src/include/qemu/osdep.h:144,
> from ../src/hw/mips/boston.c:20:
> In function ‘g_autoptr_cleanup_generic_gfree’,
> inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_load_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> 28 | g_free (*pp);
> | ^~~~~~~~~~~~
> ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> ../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared here
> 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
> | ^~~~~~~~~~~~~
> In function ‘g_autoptr_cleanup_generic_gfree’,
> inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_file_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> 28 | g_free (*pp);
> | ^~~~~~~~~~~~
> ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> ../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared here
> 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
> | ^~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/mips/boston.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers
2022-06-05 15:19 [PATCH] hw/mips/boston: Initialize g_autofree pointers Bernhard Beschow
2022-06-05 16:13 ` Richard Henderson
@ 2022-06-06 15:04 ` Philippe Mathieu-Daudé via
2022-06-10 14:04 ` Philippe Mathieu-Daudé via
2 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-06-06 15:04 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: qemu-trivial, Aleksandar Rikalo, Jiaxun Yang, Paul Burton
On 5/6/22 17:19, Bernhard Beschow wrote:
> Fixes compilation due to false positives with -Werror:
>
> In file included from /usr/include/glib-2.0/glib.h:114,
> from qemu/src/include/glib-compat.h:32,
> from qemu/src/include/qemu/osdep.h:144,
> from ../src/hw/mips/boston.c:20:
> In function ‘g_autoptr_cleanup_generic_gfree’,
> inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_load_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> 28 | g_free (*pp);
> | ^~~~~~~~~~~~
> ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> ../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared here
> 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
> | ^~~~~~~~~~~~~
> In function ‘g_autoptr_cleanup_generic_gfree’,
> inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_file_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> 28 | g_free (*pp);
> | ^~~~~~~~~~~~
> ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> ../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared here
> 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
> | ^~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/mips/boston.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/mips/boston.c b/hw/mips/boston.c
> index 59ca08b93a..1debca18ec 100644
> --- a/hw/mips/boston.c
> +++ b/hw/mips/boston.c
> @@ -787,7 +787,8 @@ static void boston_mach_init(MachineState *machine)
>
> if (kernel_size > 0) {
> int dt_size;
> - g_autofree const void *dtb_file_data, *dtb_load_data;
> + g_autofree const void *dtb_file_data = NULL;
> + g_autofree const void *dtb_load_data = NULL;
> hwaddr dtb_paddr = QEMU_ALIGN_UP(kernel_high, 64 * KiB);
> hwaddr dtb_vaddr = cpu_mips_phys_to_kseg0(NULL, dtb_paddr);
>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Queued to mips-next.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers
2022-06-05 15:19 [PATCH] hw/mips/boston: Initialize g_autofree pointers Bernhard Beschow
2022-06-05 16:13 ` Richard Henderson
2022-06-06 15:04 ` Philippe Mathieu-Daudé via
@ 2022-06-10 14:04 ` Philippe Mathieu-Daudé via
2022-06-11 15:27 ` Bernhard Beschow
2 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-06-10 14:04 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: qemu-trivial, Aleksandar Rikalo, Jiaxun Yang, Paul Burton
On 5/6/22 17:19, Bernhard Beschow wrote:
> Fixes compilation due to false positives with -Werror:
>
> In file included from /usr/include/glib-2.0/glib.h:114,
> from qemu/src/include/glib-compat.h:32,
> from qemu/src/include/qemu/osdep.h:144,
> from ../src/hw/mips/boston.c:20:
> In function ‘g_autoptr_cleanup_generic_gfree’,
> inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_load_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> 28 | g_free (*pp);
> | ^~~~~~~~~~~~
> ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> ../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared here
> 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
> | ^~~~~~~~~~~~~
> In function ‘g_autoptr_cleanup_generic_gfree’,
> inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_file_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> 28 | g_free (*pp);
> | ^~~~~~~~~~~~
> ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> ../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared here
> 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
> | ^~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/mips/boston.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Queued via mips-next.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers
2022-06-10 14:04 ` Philippe Mathieu-Daudé via
@ 2022-06-11 15:27 ` Bernhard Beschow
2022-06-11 21:48 ` Philippe Mathieu-Daudé via
0 siblings, 1 reply; 6+ messages in thread
From: Bernhard Beschow @ 2022-06-11 15:27 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: QEMU Developers, QEMU Trivial, Aleksandar Rikalo, Jiaxun Yang,
Paul Burton
[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]
On Fri, Jun 10, 2022 at 4:04 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:
> On 5/6/22 17:19, Bernhard Beschow wrote:
> > Fixes compilation due to false positives with -Werror:
> >
> > In file included from /usr/include/glib-2.0/glib.h:114,
> > from qemu/src/include/glib-compat.h:32,
> > from qemu/src/include/qemu/osdep.h:144,
> > from ../src/hw/mips/boston.c:20:
> > In function ‘g_autoptr_cleanup_generic_gfree’,
> > inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
> > /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error:
> ‘dtb_load_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> > 28 | g_free (*pp);
> > | ^~~~~~~~~~~~
> > ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> > ../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared
> here
> > 790 | g_autofree const void *dtb_file_data,
> *dtb_load_data;
> > |
> ^~~~~~~~~~~~~
> > In function ‘g_autoptr_cleanup_generic_gfree’,
> > inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
> > /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error:
> ‘dtb_file_data’ may be used uninitialized [-Werror=maybe-uninitialized]
> > 28 | g_free (*pp);
> > | ^~~~~~~~~~~~
> > ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
> > ../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared
> here
> > 790 | g_autofree const void *dtb_file_data,
> *dtb_load_data;
> > | ^~~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> >
> > Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> > ---
> > hw/mips/boston.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Queued via mips-next.
>
Hi Phil,
shouldn't this patch be visible in your pull request then?
https://patchew.org/QEMU/20220611103312.67773-1-philippe.mathieu.daude@gmail.com/
Best regards,
Bernhard
[-- Attachment #2: Type: text/html, Size: 2988 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/mips/boston: Initialize g_autofree pointers
2022-06-11 15:27 ` Bernhard Beschow
@ 2022-06-11 21:48 ` Philippe Mathieu-Daudé via
0 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-06-11 21:48 UTC (permalink / raw)
To: Bernhard Beschow
Cc: QEMU Developers, QEMU Trivial, Aleksandar Rikalo, Jiaxun Yang,
Paul Burton
On Sat, Jun 11, 2022 at 5:27 PM Bernhard Beschow <shentey@gmail.com> wrote:
> On Fri, Jun 10, 2022 at 4:04 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> On 5/6/22 17:19, Bernhard Beschow wrote:
>> > Fixes compilation due to false positives with -Werror:
>> >
>> > In file included from /usr/include/glib-2.0/glib.h:114,
>> > from qemu/src/include/glib-compat.h:32,
>> > from qemu/src/include/qemu/osdep.h:144,
>> > from ../src/hw/mips/boston.c:20:
>> > In function ‘g_autoptr_cleanup_generic_gfree’,
>> > inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:52:
>> > /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_load_data’ may be used uninitialized [-Werror=maybe-uninitialized]
>> > 28 | g_free (*pp);
>> > | ^~~~~~~~~~~~
>> > ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
>> > ../src/hw/mips/boston.c:790:52: note: ‘dtb_load_data’ was declared here
>> > 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
>> > | ^~~~~~~~~~~~~
>> > In function ‘g_autoptr_cleanup_generic_gfree’,
>> > inlined from ‘boston_mach_init’ at ../src/hw/mips/boston.c:790:36:
>> > /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘dtb_file_data’ may be used uninitialized [-Werror=maybe-uninitialized]
>> > 28 | g_free (*pp);
>> > | ^~~~~~~~~~~~
>> > ../src/hw/mips/boston.c: In function ‘boston_mach_init’:
>> > ../src/hw/mips/boston.c:790:36: note: ‘dtb_file_data’ was declared here
>> > 790 | g_autofree const void *dtb_file_data, *dtb_load_data;
>> > | ^~~~~~~~~~~~~
>> > cc1: all warnings being treated as errors
>> >
>> > Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> > ---
>> > hw/mips/boston.c | 3 ++-
>> > 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> Queued via mips-next.
>
>
> Hi Phil,
>
> shouldn't this patch be visible in your pull request then? https://patchew.org/QEMU/20220611103312.67773-1-philippe.mathieu.daude@gmail.com/
It was included, but I have been overzealous when removing Mark's PS2
series and removed it as well :/
> Best regards,
> Bernhard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-11 21:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-05 15:19 [PATCH] hw/mips/boston: Initialize g_autofree pointers Bernhard Beschow
2022-06-05 16:13 ` Richard Henderson
2022-06-06 15:04 ` Philippe Mathieu-Daudé via
2022-06-10 14:04 ` Philippe Mathieu-Daudé via
2022-06-11 15:27 ` Bernhard Beschow
2022-06-11 21:48 ` Philippe Mathieu-Daudé via
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).