Catch static analysis errors.
The errors were squashed by `find -exec`.
Change-Id: I32bb7284f2ab70eee10ca6641e13f1cafa3bb27f
diff --git a/src/api.c b/src/api.c
index 11df107..1d44691 100644
--- a/src/api.c
+++ b/src/api.c
@@ -300,6 +300,14 @@
primary_ret =
HF_VCPU_RUN_RESPONSE(HF_VCPU_RUN_MESSAGE, 0, size);
ret = 0;
+ /*
+ * clang-tidy isn't able to prove that
+ * `from->id != HF_PRIMARY_VM_ID` so cover that specific case
+ * explicitly so as not to hide other possible bugs.
+ */
+ if (from->id == HF_PRIMARY_VM_ID) {
+ vcpu = 0;
+ }
goto out;
}
@@ -386,7 +394,6 @@
/* Return pending messages without blocking. */
if (vm->mailbox.state == mailbox_state_received) {
vm->mailbox.state = mailbox_state_read;
- block = false;
ret = HF_MAILBOX_RECEIVE_RESPONSE(vm->mailbox.recv_from_id,
vm->mailbox.recv_bytes);
goto out;