From: Chen Qun
Clang static code analyzer show warning:
monitor/hmp-cmds.c:2867:17: warning: Value stored to 'set' is never read
set = true;
^
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: "Dr. David Alan Gilbert"
Cc: Philippe Mathieu-Daudé
From: Chen Qun
The "again" assignment is meaningless before g_assert_not_reached.
In addition, the break statements no longer needs to be after
g_assert_not_reached.
Clang static code analyzer show warning:
hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
aga
From: Chen Qun
Clang static code analyzer show warning:
hw/timer/exynos4210_mct.c:1370:9: warning: Value stored to 'index' is never read
index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
^ ~
hw/timer/exynos4210_mct.c:1399:9: warning: Value st
From: Chen Qun
Clang static code analyzer show warning:
hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
size = 4;
^ ~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Paolo Bonzini
Cc:Fam Zheng
---
hw/scsi/esp-pci.c | 1 -
1 file changed
From: Chen Qun
Clang static code analyzer show warning:
scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read
buflen = req->cmd.xfer;
^~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Paolo Bonzini
Cc: Fam Zheng
---
hw/scsi/scsi-disk.
From: Chen Qun
Clang static code analyzer show warning:
hw/dma/xlnx-zdma.c:399:13: warning: Value stored to 'dst_type' is never read
dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
^ ~~~
Repor
From: Chen Qun
Clang static code analyzer show warning:
hw/display/pxa2xx_lcd.c:596:9: warning: Value stored to 'format' is never read
format = 0;
^~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Andrzej Zaborowski
Cc: Peter Maydell
---
hw/display/pxa2xx_l
From: Chen Qun
The "ret" has been assigned in all branches. It didn't need to be
assigned separately.
Clang static code analyzer show warning:
migration/vmstate.c:365:17: warning: Value stored to 'ret' is never read
ret = 0;
^ ~
Reported-by: Euler Robot
S
From: Chen Qun
Clang static code analyzer show warning:
hw/display/blizzard.c:940:9: warning: Value stored to 'data' is never read
data >>= 5;
^~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Andrzej Zaborowski
Cc: Peter Maydell
---
hw/display/blizzard.c
From: Chen Qun
Clang static code analyzer show warning:
block/file-posix.c:891:9: warning: Value stored to 'op' is never read
op = RAW_PL_ABORT;
^
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Kevin Wolf
Cc: Max Reitz
---
block/file-posix.c | 1 -
From: Chen Qun
Since v1:
- Patch1: Addressed John Snow review comment.
- Patch12:Addressed Philippe Mathieu-Daudé review comment.
- Patch9: Move the 'dst_type' declaration to while() statement.
- Patch13: Move the 'set' declaration to the for() statement.
Chen Qun (13):
block/stream: Remove re
From: Chen Qun
Clang static code analyzer show warning:
hw/display/exynos4210_fimd.c:1313:17: warning: Value stored to 'is_dirty' is
never read
is_dirty = false;
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Igor Mitsyanko
Cc: Peter Maydell
---
hw/display/exynos4
From: Chen Qun
Clang static code analyzer show warning:
block/stream.c:186:9: warning: Value stored to 'ret' is never read
ret = 0;
^ ~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
Reviewed-by: John Snow
---
Cc: John Snow
Cc: Kevin Wolf
Cc: Max Reitz
---
block/str
From: Chen Qun
Clang static code analyzer show warning:
block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
flags &= ~BDRV_O_RDWR;
^
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Ronnie Sahlberg
Cc: Paolo Bonzini
Cc: Peter Lie
From: Chen Qun
Clang static code analyzer show warning:
hw/timer/exynos4210_mct.c:1370:9: warning: Value stored to 'index' is never read
index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
^ ~
hw/timer/exynos4210_mct.c:1399:9: warning: Value st
From: Chen Qun
Clang static code analyzer show warning:
block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
flags &= ~BDRV_O_RDWR;
^
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Ronnie Sahlberg
Cc: Paolo Bonzini
Cc: Peter Lie
From: Chen Qun
Clang static code analyzer show warning:
scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read
buflen = req->cmd.xfer;
^~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Paolo Bonzini
Cc: Fam Zheng
---
hw/scsi/scsi-disk.
From: Chen Qun
Clang static code analyzer show warning:
block/stream.c:186:9: warning: Value stored to 'ret' is never read
ret = 0;
^ ~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: John Snow
Cc: Kevin Wolf
Cc: Max Reitz
Cc: qemu-bl...@nongnu.org
---
block/s
From: Chen Qun
Clang static code analyzer show warning:
hw/dma/xlnx-zdma.c:399:13: warning: Value stored to 'dst_type' is never read
dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
^ ~~~
Repor
From: Chen Qun
Clang static code analyzer show warning:
hw/display/blizzard.c:940:9: warning: Value stored to 'data' is never read
data >>= 5;
^~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Andrzej Zaborowski
Cc: Peter Maydell
Cc: qemu-...@nongnu.org
---
From: Chen Qun
Clang static code analyzer show warning:
monitor/hmp-cmds.c:2867:17: warning: Value stored to 'set' is never read
set = true;
^
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: "Dr. David Alan Gilbert"
---
monitor/hmp-cmds.c | 1
From: Chen Qun
Clang static code analyzer show warning:
hw/display/pxa2xx_lcd.c:596:9: warning: Value stored to 'format' is never read
format = 0;
^~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Andrzej Zaborowski
Cc: Peter Maydell
Cc: qemu-...@nongnu.org
From: Chen Qun
The "again" assignment is meaningless before g_assert_not_reached.
In addition, the break statements no longer needs to be after
g_assert_not_reached.
Clang static code analyzer show warning:
hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
aga
From: Chen Qun
Clang static code analyzer show warning:
hw/display/exynos4210_fimd.c:1313:17: warning: Value stored to 'is_dirty' is
never read
is_dirty = false;
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Igor Mitsyanko
Cc: Peter Maydell
Cc: qemu-...@nongnu.org
From: Chen Qun
The "ret" has been assigned in all branches. It didn't need to be
assigned separately.
Clang static code analyzer show warning:
migration/vmstate.c:365:17: warning: Value stored to 'ret' is never read
ret = 0;
^ ~
Reported-by: Euler Robot
S
From: Chen Qun
Clang static code analyzer show warning:
block/file-posix.c:891:9: warning: Value stored to 'op' is never read
op = RAW_PL_ABORT;
^
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Kevin Wolf
Cc: Max Reitz
Cc: qemu-bl...@nongnu.org
---
From: Chen Qun
Clang static code analyzer show warning:
hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
size = 4;
^ ~
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
Cc: Paolo Bonzini
Cc: Fam Zheng
---
hw/scsi/esp-pci.c | 1 -
1 file change
From: Chen Qun
Hi all, our EulerRobot integrates clang static code analyzer tools and
found a lot of warnings. They are mainly redundant variable assignments.
This series fixes the warnings.
Chen Qun (13):
block/stream: Remove redundant statement in stream_run()
block/iscsi:Remove redundant
From: Chen Qun
There is memleak in test_load_qlist().It's not a big deal,
but test-vmstate will fail if sanitizers is enabled.
In addition, "ret" is written twice with the same value
in test_gtree_load_iommu().
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
tests/test-vmstate.c | 6 ++
From: Chen Qun
The device tree blob returned by load_device_tree is malloced.
We should free it after cpu_physical_memory_write().
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
hw/xtensa/xtfpga.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.
From: Chen Qun
The device tree blob returned by load_device_tree is malloced.
We should free it after cpu_physical_memory_write().
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
hw/nios2/boot.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c
index 4
From: Chen Qun
The device tree blob returned by load_device_tree is malloced.
We should free it after cpu_physical_memory_write().
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
hw/ppc/virtex_ml507.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virt
From: Chen Qun
The device tree blob returned by load_device_tree is malloced.
We should free it after cpu_physical_memory_write().Otherwise,
if we repeatedly call 'system_reset',it will repeatedly load fdt,
so there are many memleaks.
Paolo Bonzini :
https://lists.gnu.org/archive/html/qemu-devel
From: Chen Qun
We may forget to free fload. ASAN spotted it.
Reported-by: Euler Robot
Signed-off-by: Chen Qun
---
tests/test-vmstate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index cea363dd69..5b2743121b 100644
--- a/tests/test-vmstate.c
From: Chen Qun
It's easy to reproduce as follow:
virsh qemu-monitor-command vm1 --pretty '{"execute": "device-list-properties",
"arguments":{"typename":"exynos4210.uart"}}'
ASAN shows memory leak stack:
#1 0xfffd896d71cb in g_malloc0 (/lib64/libglib-2.0.so.0+0x571cb)
#2 0xaaad270beee3 in tim
From: Chen Qun
It's easy to reproduce as follow:
virsh qemu-monitor-command vm1 --pretty '{"execute": "device-list-properties",
"arguments":{"typename":"exynos4210.uart"}}'
ASAN shows memory leak stack:
#1 0xfffd896d71cb in g_malloc0 (/lib64/libglib-2.0.so.0+0x571cb)
#2 0xaaad270beee3 in tim
From: Chen Qun
Fix compilation warnings:
contrib/elf2dmp/main.c:66:17: warning: ‘KdpDataBlockEncoded’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
block = __builtin_bswap64(block ^ kdbe) ^ kwa;
^~~
contrib/elf2dmp/main.c
From: Chen Qun
According to the glibc function requirements, we need initialise
the variable. Otherwise there will be compilation warnings:
glib-autocleanups.h:28:3: warning: ‘out’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
g_free (*pp);
^~~~
Reported-by:
From: Chen Qun
Fix warning:
hw/i2c/aspeed_i2c.c: In function ‘aspeed_i2c_bus_write’:
glib/glib-autocleanups.h:28:3: warning: ‘cmd_flags’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
g_free (*pp);
^~~~
hw/i2c/aspeed_i2c.c:403:22: note: ‘cmd_flags’ was declared h
From: Chen Qun
When remove dup_fd in monitor_fdset_dup_fd_find_remove function,
we need to free mon_fdset_fd_dup. ASAN shows memory leak stack:
Direct leak of 96 byte(s) in 3 object(s) allocated from:
#0 0xfffd37b033b3 in __interceptor_calloc (/lib64/libasan.so.4+0xd33b3)
#1 0xfffd375c71
From: Chen Qun
start vm with libvirt, when GuestOS running, enter poweroff command using
the xhci keyboard, then ASAN shows memory leak stack:
Direct leak of 80 byte(s) in 5 object(s) allocated from:
#0 0xfffd1e6431cb in __interceptor_malloc (/lib64/libasan.so.4+0xd31cb)
#1 0xfffd1e10716
From: Chen Qun
The accel_list forgot to free, the asan output:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x919331cb in __interceptor_malloc (/lib64/libasan.so.4+0xd31cb)
#1 0x913f7163 in g_malloc (/lib64/libglib-2.0.so.0+0x57163)
#2 0x91413d9b in g_strsp
42 matches
Mail list logo