tests: vhost-user-test: release mutex on protocol violation
chr_read() is printing an error message and returning with s->data_mutex taken. This can potentially cause a hang. Reported by Coverity. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c5c0fdbe39
commit
9260993e27
@ -351,7 +351,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
|
||||
if (size != msg.size) {
|
||||
qos_printf("%s: Wrong message size received %d != %d\n",
|
||||
__func__, size, msg.size);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@ -509,6 +509,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
|
||||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
g_mutex_unlock(&s->data_mutex);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user