diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-30 10:51:18 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-30 10:51:18 -0600 |
commit | b0df98f3a2968eb5aba3075d1cf9b1a3931907e0 (patch) | |
tree | a728d1405d22b86de4ad994a27eb8192e619cf57 /hw/vhost.c | |
parent | 7cc2a8b14a363777e7d5b7d102176fba0cf27667 (diff) | |
parent | 99f4280854514b22972bd257fe5facc439222d2e (diff) |
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
# By Markus Armbruster (12) and others
# Via Stefan Hajnoczi
* stefanha/trivial-patches:
qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema
tests: Fix {rtc, m48t59}-test build on illumos
qemu-pixman.h: Avoid mutual inclusion loop with console.h
qemu-ga: Fix unchecked strdup() by converting to g_strdup()
qapi: Fix unchecked strdup() by converting to g_strdup()
libcacard: Fix unchecked strdup() by converting to g_strdup()
qemu-log: Plug trivial memory leak in cpu_set_log_filename()
qemu-log: Fix unchecked strdup() by converting to g_strdup()
virtfs-proxy-helper: Fix unchecked strdup() by conv. to g_strdup()
spice: Fix unchecked strdup() by converting to g_strdup()
readline: Fix unchecked strdup() by converting to g_strdup()
hw/9pfs: Fix unchecked strdup() by converting to g_strdup()
g_strdup(NULL) returns NULL; simplify
g_malloc(0) and g_malloc0(0) return NULL; simplify
xilinx_axidma: Fix debug mode compile messages
cadence_gem: Debug mode compile fixes
cadence_ttc: Debug mode compile fixes
vnc: Clean up vncws_send_handshake_response()
Diffstat (limited to 'hw/vhost.c')
-rw-r--r-- | hw/vhost.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/vhost.c b/hw/vhost.c index cee8aad4a1..0dd2a9aa40 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -269,11 +269,8 @@ static inline void vhost_dev_log_resize(struct vhost_dev* dev, uint64_t size) vhost_log_chunk_t *log; uint64_t log_base; int r, i; - if (size) { - log = g_malloc0(size * sizeof *log); - } else { - log = NULL; - } + + log = g_malloc0(size * sizeof *log); log_base = (uint64_t)(unsigned long)log; r = ioctl(dev->control, VHOST_SET_LOG_BASE, &log_base); assert(r >= 0); |