aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-09-30 13:09:39 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-09-30 13:09:40 +0100
commit2e456b2b606aef488de27f8212e22382141fa022 (patch)
tree39184cd190bedef458e5d9c698e9915ea49932b0 /include
parent45c270b1ea7987ab93e41ab095dd77370523e6b3 (diff)
parent28d16f38d0d5881f95b074cc802dae8cacc1bf58 (diff)
downloadqemu-2e456b2b606aef488de27f8212e22382141fa022.zip
qemu-2e456b2b606aef488de27f8212e22382141fa022.tar.gz
qemu-2e456b2b606aef488de27f8212e22382141fa022.tar.bz2
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pci, pc, virtio, misc bugfixes A bunch of bugfixes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 29 Sep 2014 17:59:57 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: vl: Adjust the place of calling mlockall to speedup VM's startup pc-dimm: Don't check dimm->node when there is non-NUMA config pci-hotplug-old: avoid losing error message Revert "virtio-pci: fix migration for pci bus master" loader: g_realloc(p, 0) frees and returns NULL, simplify Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/elf_ops.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h
index c6b5129..a517753 100644
--- a/include/hw/elf_ops.h
+++ b/include/hw/elf_ops.h
@@ -147,18 +147,13 @@ static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab,
}
i++;
}
- if (nsyms) {
- syms = g_realloc(syms, nsyms * sizeof(*syms));
+ syms = g_realloc(syms, nsyms * sizeof(*syms));
- qsort(syms, nsyms, sizeof(*syms), glue(symcmp, SZ));
- for (i = 0; i < nsyms - 1; i++) {
- if (syms[i].st_size == 0) {
- syms[i].st_size = syms[i + 1].st_value - syms[i].st_value;
- }
+ qsort(syms, nsyms, sizeof(*syms), glue(symcmp, SZ));
+ for (i = 0; i < nsyms - 1; i++) {
+ if (syms[i].st_size == 0) {
+ syms[i].st_size = syms[i + 1].st_value - syms[i].st_value;
}
- } else {
- g_free(syms);
- syms = NULL;
}
/* String table */