[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 105/108] kvm-all: Use 'tmpcpu' instead of 'cpu' in s
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 105/108] kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL |
Date: |
Wed, 6 Aug 2014 15:39:55 -0500 |
From: Chen Gang <address@hidden>
If kvm_arch_remove_sw_breakpoint() in CPU_FOREACH() always be fail, it
will let 'cpu' NULL. And the next kvm_arch_remove_sw_breakpoint() in
QTAILQ_FOREACH_SAFE() will get NULL parameter for 'cpu'.
And kvm_arch_remove_sw_breakpoint() can assumes 'cpu' must never be NULL,
so need define additional temporary variable for 'cpu' to avoid the case.
Cc: address@hidden
Signed-off-by: Chen Gang <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit dc54e2525389e903cee2b847cf761b5d857f75cb)
Signed-off-by: Michael Roth <address@hidden>
---
kvm-all.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index cd61496..2754c15 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -2022,12 +2022,13 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
{
struct kvm_sw_breakpoint *bp, *next;
KVMState *s = cpu->kvm_state;
+ CPUState *tmpcpu;
QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) {
if (kvm_arch_remove_sw_breakpoint(cpu, bp) != 0) {
/* Try harder to find a CPU that currently sees the breakpoint. */
- CPU_FOREACH(cpu) {
- if (kvm_arch_remove_sw_breakpoint(cpu, bp) == 0) {
+ CPU_FOREACH(tmpcpu) {
+ if (kvm_arch_remove_sw_breakpoint(tmpcpu, bp) == 0) {
break;
}
}
--
1.9.1
- [Qemu-devel] [PATCH 091/108] nbd: Close socket on negotiation failure., (continued)
- [Qemu-devel] [PATCH 091/108] nbd: Close socket on negotiation failure., Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 095/108] sdhci: Fix misuse of qemu_free_irqs(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 092/108] nbd: Shutdown socket before closing., Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 093/108] SMBIOS: Rename symbols to better reflect future use, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 096/108] hw: Fix qemu_allocate_irqs() leaks, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 098/108] virtio: validate config_len on load, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 081/108] KVM: Fix GSI number space limit, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 097/108] virtio: out-of-bounds buffer write on invalid state load, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 106/108] vmstate_xhci_event: fix unterminated field list, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 102/108] disas/libvixl: prepend the include path of libvixl header files, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 105/108] kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL,
Michael Roth <=
- [Qemu-devel] [PATCH 100/108] pci: assign devfn to pci_dev before calling pci_device_iommu_address_space(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 108/108] hw/arm/boot: Set PC correctly when loading AArch64 ELF files, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 104/108] cadence_uart: check for serial backend before using it., Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 103/108] s390x/kvm: synchronize guest floating point registers, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 107/108] hw/misc/imx_ccm.c: Add missing VMState list terminator, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 101/108] mc146818rtc: register the clock reset notifier on the right clock, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 099/108] Allow mismatched virtio config-len, Michael Roth, 2014/08/06
- Re: [Qemu-devel] [000/108] Patch Round-up for stable 2.0.1, freeze on 2014-08-12, Eric Blake, 2014/08/06