diff options
author | Jinhyung Jo <jinhyung.jo@samsung.com> | 2016-09-05 18:52:34 +0900 |
---|---|---|
committer | Jinhyung Jo <jinhyung.jo@samsung.com> | 2016-09-06 14:42:47 +0900 |
commit | fc7b6a78204b506068da09a2fba5b04b62cfcac5 (patch) | |
tree | 92e2fc754b5595e4be89ab5bb204eb2c3d59d791 /tizen | |
parent | 48742b9a80528a51d01462f6d2c57c0c5ef1b069 (diff) | |
download | qemu-fc7b6a78204b506068da09a2fba5b04b62cfcac5.tar.gz qemu-fc7b6a78204b506068da09a2fba5b04b62cfcac5.tar.bz2 qemu-fc7b6a78204b506068da09a2fba5b04b62cfcac5.zip |
tablet: fix unexpected termination issue
'Null Pointer Dereference' occurs, the emulator dies unexpectedly.
It is caused by commit f998ca30b51b5c549898763d4bd5041380a60416.
The committer have made a mistake when applying the virtio API modification.
The virtio API has been changed as follows:
previous: int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem)
current: void *virtqueue_pop(VirtQueue *vq, size_t sz)
Change-Id: I2c5a20c2741633f855ab0128f7e4dd989404b2b2
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Diffstat (limited to 'tizen')
-rw-r--r-- | tizen/src/hw/virtio/maru_virtio_tablet.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tizen/src/hw/virtio/maru_virtio_tablet.c b/tizen/src/hw/virtio/maru_virtio_tablet.c index 9a564ba502..5bab39cc95 100644 --- a/tizen/src/hw/virtio/maru_virtio_tablet.c +++ b/tizen/src/hw/virtio/maru_virtio_tablet.c @@ -148,9 +148,7 @@ static void maru_tablet_bh(void *opaque) qemu_mutex_unlock(&vt->mutex); /* Get a queue buffer which is written by guest side. */ - do { - elem = virtqueue_pop(vt->vq, sizeof(VirtQueueElement)); - } while (elem); + elem = virtqueue_pop(vt->vq, sizeof(VirtQueueElement)); qemu_mutex_lock(&vt->mutex); while (!QTAILQ_EMPTY(&events_queue)) { @@ -160,10 +158,10 @@ static void maru_tablet_bh(void *opaque) /* copy event into virtio buffer */ len = iov_from_buf(elem->in_sg, elem->in_num, push_len, &(event_entry->tablet), sizeof(EmulTabletEvent)); - if(len != sizeof(EmulTabletEvent)) { + if (len != sizeof(EmulTabletEvent)) { LOG_WARNING("len != sizeof(EmulTabletEvent).\n"); LOG_WARNING("len: %zu, sizeof(EmulTabletEvent): %zu\n", - len, sizeof(EmulTabletEvent)); + len, sizeof(EmulTabletEvent)); } push_len += sizeof(EmulTabletEvent); |