aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/s390-virtio-ccw.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 403d30e..e72c61d 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -701,12 +701,9 @@ bool hpage_1m_allowed(void)
static char *machine_get_loadparm(Object *obj, Error **errp)
{
S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
- char *loadparm_str;
/* make a NUL-terminated string */
- loadparm_str = g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1);
- loadparm_str[sizeof(ms->loadparm)] = 0;
- return loadparm_str;
+ return g_strndup((char *) ms->loadparm, sizeof(ms->loadparm));
}
static void machine_set_loadparm(Object *obj, const char *val, Error **errp)