Miscellaneous patches for 2017-03-15

-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJYyT3DAAoJEDhwtADrkYZTIUgP/0ntQk3lLJAsWKClYz9TWOkc
 LeSPjnOsrCdIOXtwuJjD9AXaUSeJintnC2O3brU7SOV7/AgNepHsECsm9c9nLjiF
 Q/EsGiJSkwnfEFUCDYwK6ZRf2x1fRSUzZmnWLGql4csWSK2ZTlGIsJ68VCFUja3G
 3sAVF4zyvHqGxAF8BFKfRHPtjqoq0hhWWmC3SqHOkK63Jx/+VquKZpswWVRobbac
 skKMNNR6PQ/mGF5eA57Y8A6LF5tlyU7aMYL1wFT2zqbD4Tth0tkkwT00TaSXasbB
 JoZmchF8Uw09KKrfSaPxLx8GevMtKAQECLZ5Bel3U0TXjF+CPwmJd5fdAOSDCI1O
 Wk8GrPwc2EjZCyj5D/oWYQhOjFg60dFVW2cXorxUMIc8GMAqKvxzyUqTC5q8zkb7
 DB4FM8g7cl9Xy53REjP//vHXeKw8yIdm1oFpXQalyqDOPb9/T4FTtyRXSteAf6Ut
 6AH6XCxlmkE/cM4tFmoAqPTTmgvMPyOtAHPQxB6ZiQDoQvG0Huc01p5jc3I2MnC2
 GmyQCXjFzStG+MG9SLsfE6eIE4iw5oaxsrKOrmZnD/ySlivTO0aAXkRS4K/uIYKP
 edULNTQMiCN5EkRMhytuqsZJ/QbzCDkdfPvSY94KIQAx917K5FkqLNB0SuveVA4J
 kDLOaV+skXZylolQ/Edk
 =Kwr2
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2017-03-15' into staging

Miscellaneous patches for 2017-03-15

# gpg: Signature made Wed 15 Mar 2017 13:12:35 GMT
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-misc-2017-03-15:
  coverity-model: model address_space_read/write
  tests: Use error_free_or_abort() where appropriate

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-03-15 17:54:41 +00:00
commit de71fb96bf
3 changed files with 17 additions and 11 deletions

View File

@ -67,18 +67,27 @@ static void __bufread(uint8_t *buf, ssize_t len)
int last = buf[len-1]; int last = buf[len-1];
} }
MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, MemTxResult address_space_read(AddressSpace *as, hwaddr addr,
uint8_t *buf, int len, bool is_write) MemTxAttrs attrs,
uint8_t *buf, int len)
{ {
MemTxResult result; MemTxResult result;
// TODO: investigate impact of treating reads as producing // TODO: investigate impact of treating reads as producing
// tainted data, with __coverity_tainted_data_argument__(buf). // tainted data, with __coverity_tainted_data_argument__(buf).
if (is_write) __bufread(buf, len); else __bufwrite(buf, len); __bufwrite(buf, len);
return result; 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 */ /* Tainting */
typedef struct {} name2keysym_t; typedef struct {} name2keysym_t;

View File

@ -93,8 +93,7 @@ static void test_find_unknown_opts(void)
/* should not return anything, we don't have an "unknown" option */ /* should not return anything, we don't have an "unknown" option */
list = qemu_find_opts_err("unknown", &err); list = qemu_find_opts_err("unknown", &err);
g_assert(list == NULL); g_assert(list == NULL);
g_assert(err); error_free_or_abort(&err);
error_free(err);
} }
static void test_qemu_find_opts(void) static void test_qemu_find_opts(void)

View File

@ -145,8 +145,7 @@ static void test_visitor_out_enum_errors(TestOutputVisitorData *data,
for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) { for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) {
err = NULL; err = NULL;
visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err); visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err);
g_assert(err); error_free_or_abort(&err);
error_free(err);
visitor_reset(data); visitor_reset(data);
} }
} }
@ -244,8 +243,7 @@ static void test_visitor_out_struct_errors(TestOutputVisitorData *data,
u.has_enum1 = true; u.has_enum1 = true;
u.enum1 = bad_values[i]; u.enum1 = bad_values[i];
visit_type_UserDefOne(data->ov, "unused", &pu, &err); visit_type_UserDefOne(data->ov, "unused", &pu, &err);
g_assert(err); error_free_or_abort(&err);
error_free(err);
visitor_reset(data); visitor_reset(data);
} }
} }