From: Marc-André Lureau Date: Tue, 23 Jun 2015 10:55:41 +0000 (+0200) Subject: ivshmem: check shm isn't already initialized X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~121^2~1^2~110^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=945001a1af36eafd093b6b1582f5282932cd3d87;p=sdk%2Femulator%2Fqemu.git ivshmem: check shm isn't already initialized The server should not change the shm, and this isn't handled by qemu and we should should verify this in qemu. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index d3d02048cd..9023f95711 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -533,6 +533,12 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size) if (incoming_posn == -1) { void * map_ptr; + if (s->shm_fd >= 0) { + error_report("shm already initialized"); + close(incoming_fd); + return; + } + if (check_shm_size(s, incoming_fd, &err) == -1) { error_report_err(err); close(incoming_fd);