summaryrefslogtreecommitdiffstats
path: root/scripts/coverity-model.c
diff options
context:
space:
mode:
authorPeter Maydell2017-03-15 18:54:41 +0100
committerPeter Maydell2017-03-15 18:54:41 +0100
commitde71fb96bfcdf6356355f49a886fbf58fe93bf87 (patch)
treef337f9c8debfe8357abfad9389f7bd2974b6c29c /scripts/coverity-model.c
parentMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ... (diff)
parentcoverity-model: model address_space_read/write (diff)
downloadqemu-de71fb96bfcdf6356355f49a886fbf58fe93bf87.tar.gz
qemu-de71fb96bfcdf6356355f49a886fbf58fe93bf87.tar.xz
qemu-de71fb96bfcdf6356355f49a886fbf58fe93bf87.zip
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>
Diffstat (limited to 'scripts/coverity-model.c')
-rw-r--r--scripts/coverity-model.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c
index ee5bf9d078..c702804f41 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;