[PATCH v2] qtest: delete superfluous inclusions of qtest.h

2021-02-26 Thread Chen Qun
There are 23 files that include the "sysemu/qtest.h", but they do not use any qtest functions. Signed-off-by: Chen Qun --- v1->v2: Change the subject base on Markus's suggestion. Cc: Markus Armbruster --- accel/tcg/cpu-exec.c| 1 - blockdev.c

[PATCH] qtest: delete redundant qtest.h header files

2021-02-24 Thread Chen Qun
There are 23 files that include the "sysemu/qtest.h", but they do not use any qtest functions. Signed-off-by: Chen Qun --- accel/tcg/cpu-exec.c| 1 - blockdev.c | 1 - hw/9pfs/9p.c| 1 - hw/arm/armv7m.c | 1

[PATCH-for-5.2? 2/2] tests/qtest: fix memleak in npcm7xx_watchdog_timer-test

2020-11-18 Thread Chen Qun
:243 Reported-by: Euler Robot Signed-off-by: Chen Qun --- tests/qtest/npcm7xx_watchdog_timer-test.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/qtest/npcm7xx_watchdog_timer-test.c b/tests/qtest/npcm7xx_watchdog_timer-test.c index 54d5d6d8f2..3aae5a0438 100644

[PATCH-for-5.2? 0/2] two qtest bugfix

2020-11-18 Thread Chen Qun
Hi folks, There are two bug caused by recent testcase code merge. EulerRobot found them, and this series fixed them. Thanks, Chen Qun Chen Qun (2): tests/qtest: variable defined by g_autofree need to be initialized tests/qtest: fix memleak in npcm7xx_watchdog_timer-test tests/qtest

[PATCH-for-5.2? 1/2] tests/qtest: variable defined by g_autofree need to be initialized

2020-11-18 Thread Chen Qun
-by: Euler Robot Signed-off-by: Chen Qun --- tests/qtest/npcm7xx_timer-test.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/qtest/npcm7xx_timer-test.c b/tests/qtest/npcm7xx_timer-test.c index f08b0cd62a..83774a5b90 100644 --- a/tests/qtest/npcm7xx_timer-test.c

[PATCH v3 3/7] accel/tcg/user-exec: silence the compiler warnings

2020-11-15 Thread Chen Qun
, old_set); | ^ ../accel/tcg/user-exec.c:172:9: note: here 172 | default: Mark the cpu_exit_tb_from_sighandler() function with QEMU_NORETURN to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Richard

[PATCH v3 2/7] hw/intc/arm_gicv3_kvm: silence the compiler warnings

2020-11-15 Thread Chen Qun
][1] = reg64; ~~^~~ hw/intc/arm_gicv3_kvm.c:652:9: note: here default: ^~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-...@nongnu.org --- hw/intc/arm_gicv3_kvm.c | 8 1 fil

[PATCH v3 6/7] ppc: Add a missing break for PPC6xx_INPUT_TBEN

2020-11-15 Thread Chen Qun
: here 123 | case PPC6xx_INPUT_INT: | ^~~~ According to the discussion, a break statement needs to be added here. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Thomas Huth Acked-by: David Gibson --- v1->v2: Add a "break" statement here inste

[PATCH v3 7/7] target/ppc: replaced the TODO with LOG_UNIMP and add break for silence warnings

2020-11-15 Thread Chen Qun
))) { |^ target/ppc/mmu_helper.c:1358:5: note: here 1358 | default: | ^~~ Use "qemu_log_mask(LOG_UNIMP**)" instead of the TODO comment. And add the break statement to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé R

[PATCH v3 0/7] silence the compiler warnings

2020-11-15 Thread Chen Qun
ave a negative impact for QEMU 5.2. Thanks, Chen Qun Since v2: - Patch3:Add Richard Henderson、Philippe Mathieu-Daudé and Thomas Huth reviewed tag. - Patch4: Laurent pull it to master, remove it. - Patch6->Patch5: Add Richard Henderson and Philippe Mathieu-Daudé reviewed tag. - Patch7->Patch

[PATCH v3 1/7] target/i386: silence the compiler warnings in gen_shiftd_rm_T1

2020-11-15 Thread Chen Qun
: warning: this statement may fall through [-Wimplicit-fallthrough=] if (is_right) { ^ target/i386/translate.c:1782:5: note: here case MO_32: ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- v1->v

[PATCH v3 4/7] target/sparc/translate: silence the compiler warnings

2020-11-15 Thread Chen Qun
atures & CPU_FEATURE_HYPV)) { |^ target/sparc/translate.c:2329:5: note: here 2329 | case GET_ASI_DIRECT: | ^~~~ The "fall through" statement place is not correctly identified by the compiler. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Artyom Ta

[PATCH v3 5/7] target/sparc/win_helper: silence the compiler warnings

2020-11-15 Thread Chen Qun
); | ^~ target/sparc/win_helper.c:306:5: note: here 306 | case 0: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Artyom Tarasenko Reviewed-b

[PATCH v2 2/5] util/qemu-timer: fix uninitialized variable warning in timer_mod_anticipate_ns()

2020-11-11 Thread Chen Qun
prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé --- Cc: Paolo Bonzini --- util/qemu-timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 81c28af517..8b73882fbb 100644 --- a

[PATCH v2 1/5] hw/rdma/rdma_backend: fix uninitialized variable warning in rdma_poll_cq()

2020-11-11 Thread Chen Qun
^~~~ hw/rdma/rdma_backend.c:93:12: note: ‘ne’ was declared here 93 | int i, ne, total_ne = 0; |^~ Add a default value for 'ne' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Marcel Apfelbaum Reviewed-by: Yuval Shaia --- Cc: Yuv

[PATCH v2 5/5] migration: fix uninitialized variable warning in migrate_send_rp_req_pages()

2020-11-11 Thread Chen Qun
d' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé --- Cc: Juan Quintela Cc: "Dr. David Alan Gilbert" --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/mig

[PATCH v2 4/5] plugins/loader: fix uninitialized variable warning in plugin_reset_uninstall()

2020-11-11 Thread Chen Qun
time' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: "Alex Bennée" --- plugins/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/loader.c b/plugins/loader.c index 8ac5dbc20f..88593fe138 100644 --- a/plugins

[PATCH v2 0/5] fix uninitialized variable warning

2020-11-11 Thread Chen Qun
um and Yuval Shaia review comment. --patch3->patch2: Add Philippe Mathieu-Daudé review comment. --patch6->patch5: Add Philippe Mathieu-Daudé review comment. Chen Qun (5): hw/rdma/rdma_backend: fix uninitialized variable warning in rdma_poll_cq() util/qemu-timer: fix uninitiali

[PATCH v2 3/5] util/qemu-timer: fix uninitialized variable warning for expire_time

2020-11-11 Thread Chen Qun
st->clock->type); | ~~^~ Add a default value for 'expire_time' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Paolo Bonzini --- util/qemu-timer.c | 4 ++-- 1 file ch

[PATCH-for-5.2 v2] hw/intc: fix heap-buffer-overflow in rxicu_realize()

2020-11-11 Thread Chen Qun
(/lib64/libc.so.6+0x26d42) Add the 'ice->src[i].sense' initialize to the default value, and then process init_sense array to identify which irqs should be level-triggered. Suggested-by: Peter Maydell Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Yoshinori Sato v1->v2:

[PATCH] hw/intc: fix heap-buffer-overflow in rxicu_realize()

2020-11-04 Thread Chen Qun
:49 #16 0x7feefafa5d42 in __libc_start_main (/lib64/libc.so.6+0x26d42) Change the 'j < icu->nr_sense' condition place to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Yoshinori Sato --- hw/intc/rx_icu.c | 6 ++ 1 file changed, 2 insertions(+),

[PATCH 6/6] migration: fix uninitialized variable warning in migrate_send_rp_req_pages()

2020-11-02 Thread Chen Qun
ned-off-by: Chen Qun --- Cc: Juan Quintela Cc: "Dr. David Alan Gilbert" --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 9bb4fee5ac..de90486a61 100644 --- a/migration/migration.c +++ b/m

[PATCH 0/6] fix uninitialized variable warning

2020-11-02 Thread Chen Qun
Hi all, There are some variables initialized warnings reported by the compiler, even if the default CFLAG for the compiler parameters are uesed. This serial has added some default values or changed the assignment places for the variablies to fix them. Thanks, Chen Qun Chen Qun (6): target

[PATCH 3/6] util/qemu-timer: fix uninitialized variable warning in timer_mod_anticipate_ns()

2020-11-02 Thread Chen Qun
function ‘timer_mod_anticipate_ns’: util/qemu-timer.c:474:8: warning: ‘rearm’ may be used uninitialized in this function [-Wmaybe-uninitialized] 474 | if (rearm) { |^ Change the default value assignment place to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen

[PATCH 1/6] target/xtensa: fix uninitialized variable warning

2020-11-02 Thread Chen Qun
m_bits(isa, rf); | ^~~~ Add a default value for 'rf' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Max Filippov --- target/xtensa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/xtensa/translate.c b/target

[PATCH 5/6] plugins/loader: fix uninitialized variable warning in plugin_reset_uninstall()

2020-11-02 Thread Chen Qun
Signed-off-by: Chen Qun --- Cc: "Alex Bennée" --- plugins/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/loader.c b/plugins/loader.c index 8ac5dbc20f..88593fe138 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -367,7 +367,7 @@ void

[PATCH 4/6] util/qemu-timer: fix uninitialized variable warning for expire_time

2020-11-02 Thread Chen Qun
;clock->type); | ~~^~ Add a default value for 'expire_time' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Paolo Bonzini --- util/qemu-timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-timer.c

[PATCH 2/6] hw/rdma/rdma_backend: fix uninitialized variable warning in rdma_poll_cq()

2020-11-02 Thread Chen Qun
93 | int i, ne, total_ne = 0; |^~ Add a default value for 'ne' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Yuval Shaia Cc: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 2/8] hw/intc/arm_gicv3_kvm: silence the compiler warnings

2020-10-29 Thread Chen Qun
][1] = reg64; ~~^~~ hw/intc/arm_gicv3_kvm.c:652:9: note: here default: ^~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-...@nongnu.org --- hw/intc/arm_gicv3_kvm.c | 8 1 fil

[PATCH v2 7/8] ppc: Add a missing break for PPC6xx_INPUT_TBEN

2020-10-29 Thread Chen Qun
: here 123 | case PPC6xx_INPUT_INT: | ^~~~ According to the discussion, a break statement needs to be added here. Reported-by: Euler Robot Signed-off-by: Chen Qun --- v1->v2: Add a "break" statement here instead of /* fall through */ comments (Base on Thomas'

[PATCH v2 1/8] target/i386: silence the compiler warnings in gen_shiftd_rm_T1

2020-10-29 Thread Chen Qun
s statement may fall through [-Wimplicit-fallthrough=] if (is_right) { ^ target/i386/translate.c:1782:5: note: here case MO_32: ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- v1->v2: Add comments

[PATCH v2 3/8] accel/tcg/user-exec: silence the compiler warnings

2020-10-29 Thread Chen Qun
); | ^ ../accel/tcg/user-exec.c:172:9: note: here 172 | default: Mark the cpu_exit_tb_from_sighandler() function with QEMU_NORETURN to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- v1->v2: Add QEMU_NORETURN

[PATCH v2 6/8] target/sparc/win_helper: silence the compiler warnings

2020-10-29 Thread Chen Qun
); | ^~ target/sparc/win_helper.c:306:5: note: here 306 | case 0: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Artyom Tarasenko --- v1->v2: Combin

[PATCH v2 8/8] target/ppc: replaced the TODO with LOG_UNIMP and add break for silence warnings

2020-10-29 Thread Chen Qun
))) { |^ target/ppc/mmu_helper.c:1358:5: note: here 1358 | default: | ^~~ Use "qemu_log_mask(LOG_UNIMP**)" instead of the TODO comment. And add the break statement to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- v1->v2: replace the TODO by a LOG_U

[PATCH v2 5/8] target/sparc/translate: silence the compiler warnings

2020-10-29 Thread Chen Qun
ATURE_HYPV)) { |^ target/sparc/translate.c:2329:5: note: here 2329 | case GET_ASI_DIRECT: | ^~~~ The "fall through" statement place is not correctly identified by the compiler. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Artyom Tarasenko R

[PATCH v2 4/8] linux-user/mips/cpu_loop: silence the compiler warnings

2020-10-29 Thread Chen Qun
ned-off-by: Chen Qun Reviewed-by: Thomas Huth --- Cc: Laurent Vivier --- linux-user/mips/cpu_loop.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 553e8ca7f5..cfe7ba5c47 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux

[PATCH v2 0/8] silence the compiler warnings

2020-10-29 Thread Chen Qun
ll through */ comments. - Patch8: Replace the TODO by a LOG_UNIMP call and add break statement - Patch9: Discard this patch since a patch already exists for fix this issue(https://lore.kernel.org/qemu-devel/20200711154242.41222-1-ysato@users) Chen Qun (8): target/i386: silence the compiler w

[PATCH] target/ppc/excp_helper: Add a fallthrough for fix compiler warning

2020-10-27 Thread Chen Qun
ode; | ^~ ../target/ppc/excp_helper.c:530:5: note: here 530 | case POWERPC_EXCP_HDECR: /* Hypervisor decrementer exception */ | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --

[PATCH 7/9] ppc: silence the compiler warnings

2020-10-27 Thread Chen Qun
: here 123 | case PPC6xx_INPUT_INT: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: David Gibson --- hw/ppc/ppc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/ppc.c b/hw/ppc/p

[PATCH 4/9] linux-user/mips/cpu_loop: silence the compiler warnings

2020-10-27 Thread Chen Qun
ned-off-by: Chen Qun --- Cc: Laurent Vivier --- linux-user/mips/cpu_loop.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 553e8ca7f5..cfe7ba5c47 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -104,

[PATCH 8/9] target/ppc: silence the compiler warnings

2020-10-27 Thread Chen Qun
))) { |^ target/ppc/mmu_helper.c:1358:5: note: here 1358 | default: | ^~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: David Gibson --- target/ppc/mmu_helper.c | 1 + 1 file changed, 1 insertion(+)

[PATCH 9/9] hw/timer/renesas_tmr: silence the compiler warnings

2020-10-27 Thread Chen Qun
| ^ ../hw/timer/renesas_tmr.c:224:5: note: here 224 | case A_TCORB: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Yoshinori Sato Cc: Magnus Damm --- hw/timer/renesas_tmr.c | 1 + 1 file changed, 1

[PATCH 3/9] accel/tcg/user-exec: silence the compiler warnings

2020-10-27 Thread Chen Qun
ot; instead of "NORETURN" here. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Riku Voipio Cc: Richard Henderson Cc: Paolo Bonzini --- accel/tcg/user-exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 4

[PATCH 6/9] target/sparc/win_helper: silence the compiler warnings

2020-10-27 Thread Chen Qun
); | ^~ target/sparc/win_helper.c:306:5: note: here 306 | case 0: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Mark Cave-Ayland Cc: Artyom Tarasenko -

[PATCH 5/9] target/sparc/translate: silence the compiler warnings

2020-10-27 Thread Chen Qun
ATURE_HYPV)) { |^ target/sparc/translate.c:2329:5: note: here 2329 | case GET_ASI_DIRECT: | ^~~~ The "fall through" statement place is not correctly identified by the compiler. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Mark Cave-Ayland

[PATCH 2/9] hw/intc/arm_gicv3_kvm: silence the compiler warnings

2020-10-27 Thread Chen Qun
][1] = reg64; ~~^~~ hw/intc/arm_gicv3_kvm.c:652:9: note: here default: ^~~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Peter Maydell Cc: qemu-...@nongnu.org --- hw/intc/arm_gicv3_kvm.c | 8 1 file changed, 8 insertions(+) diff --g

[PATCH 1/9] target/i386: silence the compiler warnings in gen_shiftd_rm_T1

2020-10-27 Thread Chen Qun
s statement may fall through [-Wimplicit-fallthrough=] if (is_right) { ^ target/i386/translate.c:1782:5: note: here case MO_32: ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost --- target/i386/

[PATCH 0/9] silence the compiler warnings

2020-10-27 Thread Chen Qun
Hi all, When building with GCC9 using CFLAG -Wimplicit-fallthrough=2 we get a lot of warning. Some problems may be missing break statements which I have submitted the patch separately. This series is all add the corresponding "fall through" comment to fix them. Chen Qun (9): t

[PATCH] target/ppc/excp_helper: Add a missing break for POWERPC_EXCP_HISI

2020-10-27 Thread Chen Qun
ode; | ^~ ../target/ppc/excp_helper.c:530:5: note: here 530 | case POWERPC_EXCP_HDECR: /* Hypervisor decrementer exception */ | ^~~~ A break statement may be required to enter this exception. Reported-by: Euler Robot Signed-off-by: Chen Qun --- I gu

[PATCH RESEND v2 2/7] qga/channel-posix: Plug memory leak in ga_channel_write_all()

2020-10-22 Thread Chen Qun
From: Pan Nengyuan Missing g_error_free on error path in ga_channel_write_all(). Fix that. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Li Qiang Signed-off-by: Chen Qun --- Cc: Michael Roth --- qga/channel-posix.c | 6 +- 1 file changed, 5 insertions(+), 1

[PATCH RESEND v2 5/7] migration/colo: Plug memleaks in colo_process_incoming_thread

2020-10-22 Thread Chen Qun
From: Pan Nengyuan 'local_err' forgot to free in colo_process_incoming_thread error path. Fix that. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Li Qiang Signed-off-by: Chen Qun --- Cc: Hailiang Zhang Cc: Juan Quintela Cc: "Dr. David Alan Gilbert&q

[PATCH RESEND v2 6/7] blockdev: Fix a memleak in drive_backup_prepare()

2020-10-22 Thread Chen Qun
From: Pan Nengyuan 'local_err' seems forgot to propagate in error path, it'll cause a memleak. Fix it. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Kevin Wolf Reviewed-by: Li Qiang Signed-off-by: Chen Qun --- blockdev.c | 1 + 1 file changed, 1 ins

[PATCH RESEND v2 1/7] tests/migration: fix memleak in wait_command/wait_command_fd

2020-10-22 Thread Chen Qun
-helpers.c:148 #14 0x557bf3c43b8f in test_migrate_auto_converge ../tests/qtest/migration-test.c:1243 .. Fix: 5e34005571af5 Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Thomas Huth Cc: Laurent Vivier Cc: Maxim Levitsky Cc: Paolo Bonzini --- tests/qtest/migration-helpers.c

[PATCH RESEND v2 7/7] block/file-posix: fix a possible undefined behavior

2020-10-22 Thread Chen Qun
Wolf Reviewed-by: Li Qiang Signed-off-by: Chen Qun --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index c63926d592..b711124672 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2110,7 +2110,7 @@ static

[PATCH RESEND v2 4/7] elf2dmp/pdb: Plug memleak in pdb_init_from_file

2020-10-22 Thread Chen Qun
From: Pan Nengyuan Missing g_error_free in pdb_init_from_file() error path. Fix that. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Viktor Prutyanov Reviewed-by: Li Qiang Signed-off-by: Chen Qun --- contrib/elf2dmp/pdb.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH RESEND v2 0/7] some memleak trivial patchs

2020-10-22 Thread Chen Qun
Hi all, Here are some memory leak patches reported by EulerRobot. Some patch submissions have been unattended for a while and I resend them. Thanks, Chen Qun Chen Qun (1): tests/migration: fix memleak in wait_command/wait_command_fd Pan Nengyuan (6): qga/channel-posix: Plug memory leak

[PATCH RESEND v2 3/7] elf2dmp/qemu_elf: Plug memleak in QEMU_Elf_init

2020-10-22 Thread Chen Qun
From: Pan Nengyuan Missing g_error_free in QEMU_Elf_init() error path. Fix that. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Viktor Prutyanov Reviewed-by: Li Qiang Signed-off-by: Chen Qun --- contrib/elf2dmp/qemu_elf.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] tests/migration: fix memleak in wait_command/wait_command_fd

2020-10-21 Thread Chen Qun
-helpers.c:148 #14 0x557bf3c43b8f in test_migrate_auto_converge ../tests/qtest/migration-test.c:1243 .. SUMMARY: AddressSanitizer: 11670244 byte(s) leaked in 8422 allocation(s). Reported-by: Euler Robot Signed-off-by: Chen Qun --- tests/qtest/migration-helpers.c | 16 1

[PATCH v3] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-14 Thread Chen Qun
_name, sizeof(s->bitmap_name)); ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- v2->v3: Placing the declaration at the beginning of the block(Base on Max's suggestion). Cc: Max Reitz Cc: Vladimir Sementso

[PATCH v2] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Chen Qun
_name, sizeof(s->bitmap_name)); ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Vladimir Sementsov-Ogievskiy Cc: Laurent Vivier Cc: Li Qiang --- migration/block-dirty-bitmap.c | 9 ++--- 1 file changed, 2

[PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-10 Thread Chen Qun
p_name)); ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- migration/block-dirty-bitmap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 5bef793ac0..e09ea4f22b

[PATCH v3 05/10] hw/virtio/vhost-user:Remove dead assignment in scrub_shadow_regions()

2020-08-27 Thread Chen Qun
Robot Signed-off-by: Chen Qun Reviewed-by: Raphael Norwitz --- Cc: "Michael S. Tsirkin" Cc: Raphael Norwitz --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index d7e2423762..9c5b4f7f

[PATCH v3 10/10] hw/display/vga:Remove redundant statement in vga_draw_graphic()

2020-08-27 Thread Chen Qun
Clang static code analyzer show warning: hw/display/vga.c:1677:9: warning: Value stored to 'update' is never read update = full_update; ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Gerd Hoffmann Reviewed-by: Li Qiang --- Cc: Ger

[PATCH v3 08/10] usb/bus: Remove dead assignment in usb_get_fw_dev_path()

2020-08-27 Thread Chen Qun
Clang static code analyzer show warning: qemu/hw/usb/bus.c:615:13: warning: Value stored to 'pos' is never read pos += snprintf(fw_path + pos, fw_len - pos, "%s@%lx", Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Markus Armbruster --- Cc: Gerd

[PATCH v3 09/10] hw/intc: fix default registers value in exynos4210_combiner_read()

2020-08-27 Thread Chen Qun
Clang static code analyzer show warning: hw/intc/exynos4210_combiner.c:231:9: warning: Value stored to 'val' is never read val = s->reg_set[offset >> 2]; The default register return value should be return 'val'. Reported-by: Euler Robot Signed-off-by: Che

[PATCH v3 07/10] vfio/platform: Remove dead assignment in vfio_intp_interrupt()

2020-08-27 Thread Chen Qun
Clang static code analyzer show warning: hw/vfio/platform.c:239:9: warning: Value stored to 'ret' is never read ret = event_notifier_test_and_clear(intp->interrupt); ^ ~~ Reported-by: Euler Robot Signed-off-by: Chen Qun

[PATCH v3 06/10] hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check()

2020-08-27 Thread Chen Qun
tement is the same as that of the first two statements. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang --- Cc: "Michael S. Tsirkin" Cc: Jason Wang --- hw/net/virtio-net.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v3 02/10] hw/arm/omap1:Remove redundant statement in omap_clkdsp_read()

2020-08-27 Thread Chen Qun
Clang static code analyzer show warning: hw/arm/omap1.c:1760:15: warning: Value stored to 'cpu' during its initialization is never read CPUState *cpu = CPU(s->cpu); ^~~ ~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Peter Maydell Re

[PATCH v3 00/10] trivial patchs for static code analyzer fixes

2020-08-27 Thread Chen Qun
. - Patch7: Addressed Stefan Hajnoczi and Li Qiang review comment. - Patch8: Addressed Markus Armbruster review comment. - Patch9: Change default return value in exynos4210_combiner_read(). Chen Qun (10): hw/arm/virt-acpi-build:Remove dead assignment in build_madt() hw/arm/omap1:Remove redundant

[PATCH v3 03/10] target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli()

2020-08-27 Thread Chen Qun
to 'tcg_rd' during its initialization is never read TCGv_i64 tcg_rd = new_tmp_a64(s); ^~ ~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-...@nongnu.org v2->v3:According to Peter's r

[PATCH v3 04/10] target/arm/translate-a64:Remove redundant statement in disas_simd_two_reg_misc_fp16()

2020-08-27 Thread Chen Qun
extract32(insn, 5, 5); ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-...@nongnu.org --- target/arm/translate-a64.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/arm/translate-a64.c b/target

[PATCH v3 01/10] hw/arm/virt-acpi-build:Remove dead assignment in build_madt()

2020-08-27 Thread Chen Qun
Clang static code analyzer show warning: hw/arm/virt-acpi-build.c:641:5: warning: Value stored to 'madt' is never read madt = acpi_data_push(table_data, sizeof *madt); ^ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewe

[PATCH v2 10/10] hw/display/vga:Remove redundant statement in vga_draw_graphic()

2020-08-25 Thread Chen Qun
Clang static code analyzer show warning: hw/display/vga.c:1677:9: warning: Value stored to 'update' is never read update = full_update; ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Gerd Hoffmann --- Cc: Gerd Hoffmann --- hw/dis

[PATCH v2 06/10] hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check()

2020-08-25 Thread Chen Qun
tement is the same as that of the first two statements. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé --- Cc: "Michael S. Tsirkin" Cc: Jason Wang --- hw/net/virtio-net.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/net/virtio-

[PATCH v2 07/10] vfio/platform: Remove dead assignment in vfio_intp_interrupt()

2020-08-25 Thread Chen Qun
Clang static code analyzer show warning: hw/vfio/platform.c:239:9: warning: Value stored to 'ret' is never read ret = event_notifier_test_and_clear(intp->interrupt); ^ ~~ Reported-by: Euler Robot Signed-off-by: Chen Qun

[PATCH v2 09/10] hw/intc: Remove redundant statement in exynos4210_combiner_read()

2020-08-25 Thread Chen Qun
n 'val'. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Igor Mitsyanko Cc: Peter Maydell --- hw/intc/exynos4210_combiner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index b8561e4180..e2e

[PATCH v2 02/10] hw/arm/omap1:Remove redundant statement in omap_clkdsp_read()

2020-08-25 Thread Chen Qun
Clang static code analyzer show warning: hw/arm/omap1.c:1760:15: warning: Value stored to 'cpu' during its initialization is never read CPUState *cpu = CPU(s->cpu); ^~~ ~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Peter Mayd

[PATCH v2 03/10] target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli()

2020-08-25 Thread Chen Qun
to 'tcg_rd' during its initialization is never read TCGv_i64 tcg_rd = new_tmp_a64(s); ^~ ~~ There is a memory leak for the variable new_tmp_a64 "s". We should delete the assignment. Reported-by: Euler Robot Signed-off-by: Chen Qun -

[PATCH v2 04/10] target/arm/translate-a64:Remove redundant statement in disas_simd_two_reg_misc_fp16()

2020-08-25 Thread Chen Qun
extract32(insn, 5, 5); ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Peter Maydell Cc: qemu-...@nongnu.org --- target/arm/translate-a64.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c8

[PATCH v2 08/10] usb/bus: Remove dead assignment in usb_get_fw_dev_path()

2020-08-25 Thread Chen Qun
Clang static code analyzer show warning: qemu/hw/usb/bus.c:615:13: warning: Value stored to 'pos' is never read pos += snprintf(fw_path + pos, fw_len - pos, "%s@%lx", Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Gerd Hoffmann Cc: Markus Armbruster -

[PATCH v2 05/10] hw/virtio/vhost-user:Remove dead assignment in scrub_shadow_regions()

2020-08-25 Thread Chen Qun
Robot Signed-off-by: Chen Qun Reviewed-by: Raphael Norwitz --- Cc: "Michael S. Tsirkin" Cc: Raphael Norwitz --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index d7e2423762..9c5b4f7f

[PATCH v2 00/10] trivial patchs for static code analyzer fixes

2020-08-25 Thread Chen Qun
comment. - Patch8: drop the patch "tcg/optimize:** " follow Richard Henderson comment. - Patch9->Patch8: The patch code format is modified because spaces are missing. - Patch11->Patch10: Addressed Gerd Hoffmann review comment. Thanks. Chen Qun (10): hw/arm/virt-acpi-build:Remove

[PATCH v2 01/10] hw/arm/virt-acpi-build:Remove dead assignment in build_madt()

2020-08-25 Thread Chen Qun
Clang static code analyzer show warning: hw/arm/virt-acpi-build.c:641:5: warning: Value stored to 'madt' is never read madt = acpi_data_push(table_data, sizeof *madt); ^ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewe

[PATCH 11/11] hw/display/vga:Remove redundant statement in vga_draw_graphic()

2020-08-13 Thread Chen Qun
Clang static code analyzer show warning: hw/display/vga.c:1677:9: warning: Value stored to 'update' is never read update = full_update; ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Gerd Hoffmann --- hw/display/vga.c | 1 - 1 file

[PATCH 09/11] usb/bus: Remove dead assignment in usb_get_fw_dev_path()

2020-08-13 Thread Chen Qun
Clang static code analyzer show warning: qemu/hw/usb/bus.c:615:13: warning: Value stored to 'pos' is never read pos += snprintf(fw_path + pos, fw_len - pos, "%s@%lx", Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Gerd Hoffmann Cc: Markus Armbruster -

[PATCH 01/11] hw/arm/virt-acpi-build:Remove dead assignment in build_madt()

2020-08-13 Thread Chen Qun
Clang static code analyzer show warning: hw/arm/virt-acpi-build.c:641:5: warning: Value stored to 'madt' is never read madt = acpi_data_push(table_data, sizeof *madt); ^ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Sh

[PATCH 03/11] target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli()

2020-08-13 Thread Chen Qun
to 'tcg_rd' during its initialization is never read TCGv_i64 tcg_rd = new_tmp_a64(s); ^~ ~~ There is a memory leak for the variable new_tmp_a64 "s". We should delete the assignment. Reported-by: Euler Robot Signed-off-by: Chen Qun -

[PATCH 10/11] hw/intc: Remove redundant statement in exynos4210_combiner_read()

2020-08-13 Thread Chen Qun
n 'val'. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Igor Mitsyanko Cc: Peter Maydell --- hw/intc/exynos4210_combiner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index b8561e4180..e2e

[PATCH 06/11] hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check()

2020-08-13 Thread Chen Qun
tement is the same as that of the first two statements. Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: "Michael S. Tsirkin" Cc: Jason Wang --- hw/net/virtio-net.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index a1fe9e9285.

[PATCH 00/11] trivial patchs for static code analyzer fixes

2020-08-13 Thread Chen Qun
Hi All, This series fix trivial warnings reported by the Clang static code analyzer. Chen Qun (11): hw/arm/virt-acpi-build:Remove dead assignment in build_madt() hw/arm/omap1:Remove redundant statement in omap_clkdsp_read() target/arm/translate-a64:Remove dead assignment in

[PATCH 08/11] tcg/optimize: Remove redundant statement in tcg_optimize()

2020-08-13 Thread Chen Qun
Clang static code analyzer show warning: tcg/optimize.c:1267:17: warning: Value stored to 'nb_iargs' is never read nb_iargs = 2; ^ ~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Richard Henderson Cc: Richard Henderson --- tcg/

[PATCH 04/11] target/arm/translate-a64:Remove redundant statement in disas_simd_two_reg_misc_fp16()

2020-08-13 Thread Chen Qun
extract32(insn, 5, 5); ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Peter Maydell Cc: qemu-...@nongnu.org --- target/arm/translate-a64.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c8

[PATCH 05/11] hw/virtio/vhost-user:Remove dead assignment in scrub_shadow_regions()

2020-08-13 Thread Chen Qun
Robot Signed-off-by: Chen Qun --- Cc: "Michael S. Tsirkin" Cc: Raphael Norwitz --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index d7e2423762..9c5b4f7fbc 100644 --- a/hw/virtio/vhost-user

[PATCH 02/11] hw/arm/omap1:Remove redundant statement in omap_clkdsp_read()

2020-08-13 Thread Chen Qun
Clang static code analyzer show warning: hw/arm/omap1.c:1760:15: warning: Value stored to 'cpu' during its initialization is never read CPUState *cpu = CPU(s->cpu); ^~~ ~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Peter Mayd

[PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt()

2020-08-13 Thread Chen Qun
Clang static code analyzer show warning: hw/vfio/platform.c:239:9: warning: Value stored to 'ret' is never read ret = event_notifier_test_and_clear(intp->interrupt); ^ ~~ Reported-by: Euler Robot Signed-off-by: Che

[PATCH v2] crypto: Redundant type conversion for AES_KEY pointer

2020-05-05 Thread Chen Qun
We can delete the redundant type conversion if we set the the AES_KEY parameter with 'const' in qcrypto_cipher_aes_ecb_(en|de)crypt() function. Reported-by: Euler Robot Signed-off-by: Chen Qun --- v1->v2: Cc: "Daniel P. Berrangé" Modify the AES_KEY pa

[PATCH] block/iscsi:fix heap-buffer-overflow in iscsi_aio_ioctl_cb

2020-04-17 Thread Chen Qun
-softmmu/qemu-system-aarch64+0x2c00740) Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Stefan Hajnoczi --- v1->v2: Use MIN() macro for mx_sb_len and sb_len_wr. (Base comments from Michael S. Tsirkin, Stefan Hajnoczi, Kevin Wolf) Cc: Stefan Hajnoczi Cc: Kevin Wolf Cc: Michael S

[PATCH 2/3] virtio-crypto: fix 80-char limit violations in virtio_crypto_device_realize()

2020-03-25 Thread Chen Qun
Fix: aa8f057e74ae Reported-by: Euler Robot Signed-off-by: Chen Qun --- hw/virtio/virtio-crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 4c65114de5..eb4a9e4e85 100644 --- a/hw/virtio/virtio-crypto.c +++ b

[PATCH 1/3] gdbstub: prevent uninitialized warning

2020-03-25 Thread Chen Qun
function [-Wmaybe-uninitialized] g_free (*pp); ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: "Alex Bennée" Cc: "Philippe Mathieu-Daudé" --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstu

[PATCH 0/3] Three trivial patchs

2020-03-25 Thread Chen Qun
Patch1: For g_autofree type initialized. Patch2: Juest 80-char limit for virtio-crypto. Patch3: Redundant type conversion for crypto. Chen Qun (3): gdbstub: prevent uninitialized warning virtio-crypto: fix 80-char limit violations in virtio_crypto_device_realize() crypto: Redundant type

  1   2   >