summaryrefslogtreecommitdiff
path: root/tizen
diff options
context:
space:
mode:
authorJinhyung Jo <jinhyung.jo@samsung.com>2016-09-05 18:52:34 +0900
committerJinhyung Jo <jinhyung.jo@samsung.com>2016-09-06 14:42:47 +0900
commitfc7b6a78204b506068da09a2fba5b04b62cfcac5 (patch)
tree92e2fc754b5595e4be89ab5bb204eb2c3d59d791 /tizen
parent48742b9a80528a51d01462f6d2c57c0c5ef1b069 (diff)
downloadqemu-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.c8
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);