diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c index ee5bf9d078b8b4cedc6c5b8b06bc6b5b55949dcb..c702804f41c17c1cf5cf6e09aa1ec8516ebfed52 100644 --- a/scripts/coverity-model.c +++ b/scripts/coverity-model.c @@ -67,18 +67,27 @@ static void __bufread(uint8_t *buf, ssize_t len) int last = buf[len-1]; } -MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - uint8_t *buf, int len, bool is_write) +MemTxResult address_space_read(AddressSpace *as, hwaddr addr, + MemTxAttrs attrs, + uint8_t *buf, int len) { MemTxResult result; - // TODO: investigate impact of treating reads as producing // tainted data, with __coverity_tainted_data_argument__(buf). - if (is_write) __bufread(buf, len); else __bufwrite(buf, len); + __bufwrite(buf, len); + return result; +} +MemTxResult address_space_write(AddressSpace *as, hwaddr addr, + MemTxAttrs attrs, + const uint8_t *buf, int len) +{ + MemTxResult result; + __bufread(buf, len); return result; } + /* Tainting */ typedef struct {} name2keysym_t; diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c index f6310b34f13d1b2724c3cdff4aaf9b511ef815c0..0ad74b464f2b6c50c6a377c777e1c01936237f6f 100644 --- a/tests/test-qemu-opts.c +++ b/tests/test-qemu-opts.c @@ -93,8 +93,7 @@ static void test_find_unknown_opts(void) /* should not return anything, we don't have an "unknown" option */ list = qemu_find_opts_err("unknown", &err); g_assert(list == NULL); - g_assert(err); - error_free(err); + error_free_or_abort(&err); } static void test_qemu_find_opts(void) diff --git a/tests/test-qobject-output-visitor.c b/tests/test-qobject-output-visitor.c index 500b452d98efafd27d1c034405eda7207e042f2d..c213fceeb30d52aa7f3b249a1598cd2b50174054 100644 --- a/tests/test-qobject-output-visitor.c +++ b/tests/test-qobject-output-visitor.c @@ -145,8 +145,7 @@ static void test_visitor_out_enum_errors(TestOutputVisitorData *data, for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) { err = NULL; visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err); - g_assert(err); - error_free(err); + error_free_or_abort(&err); visitor_reset(data); } } @@ -244,8 +243,7 @@ static void test_visitor_out_struct_errors(TestOutputVisitorData *data, u.has_enum1 = true; u.enum1 = bad_values[i]; visit_type_UserDefOne(data->ov, "unused", &pu, &err); - g_assert(err); - error_free(err); + error_free_or_abort(&err); visitor_reset(data); } }