aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/libqos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtest/libqos')
-rw-r--r--tests/qtest/libqos/ahci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c
index 2946abc15a..fba3e7a954 100644
--- a/tests/qtest/libqos/ahci.c
+++ b/tests/qtest/libqos/ahci.c
@@ -637,10 +637,13 @@ void ahci_exec(AHCIQState *ahci, uint8_t port,
AHCICommand *cmd;
int rc;
AHCIOpts *opts;
+ uint64_t buffer_in;
opts = g_memdup((opts_in == NULL ? &default_opts : opts_in),
sizeof(AHCIOpts));
+ buffer_in = opts->buffer;
+
/* No guest buffer provided, create one. */
if (opts->size && !opts->buffer) {
opts->buffer = ahci_alloc(ahci, opts->size);
@@ -686,7 +689,7 @@ void ahci_exec(AHCIQState *ahci, uint8_t port,
g_assert_cmpint(rc, ==, 0);
}
ahci_command_free(cmd);
- if (opts->buffer != opts_in->buffer) {
+ if (opts->buffer != buffer_in) {
ahci_free(ahci, opts->buffer);
}
g_free(opts);