diff options
-rw-r--r-- | Documentation/lguest/lguest.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 42008395534d..9b0e322118b5 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -1040,6 +1040,11 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1040 | / getpagesize(); | 1040 | / getpagesize(); |
1041 | p = get_pages(pages); | 1041 | p = get_pages(pages); |
1042 | 1042 | ||
1043 | /* Initialize the virtqueue */ | ||
1044 | vq->next = NULL; | ||
1045 | vq->last_avail_idx = 0; | ||
1046 | vq->dev = dev; | ||
1047 | |||
1043 | /* Initialize the configuration. */ | 1048 | /* Initialize the configuration. */ |
1044 | vq->config.num = num_descs; | 1049 | vq->config.num = num_descs; |
1045 | vq->config.irq = devices.next_irq++; | 1050 | vq->config.irq = devices.next_irq++; |
@@ -1057,9 +1062,6 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1057 | for (i = &dev->vq; *i; i = &(*i)->next); | 1062 | for (i = &dev->vq; *i; i = &(*i)->next); |
1058 | *i = vq; | 1063 | *i = vq; |
1059 | 1064 | ||
1060 | /* Link virtqueue back to device. */ | ||
1061 | vq->dev = dev; | ||
1062 | |||
1063 | /* Set the routine to call when the Guest does something to this | 1065 | /* Set the routine to call when the Guest does something to this |
1064 | * virtqueue. */ | 1066 | * virtqueue. */ |
1065 | vq->handle_output = handle_output; | 1067 | vq->handle_output = handle_output; |
@@ -1093,6 +1095,7 @@ static struct device *new_device(const char *name, u16 type, int fd, | |||
1093 | dev->desc = new_dev_desc(type); | 1095 | dev->desc = new_dev_desc(type); |
1094 | dev->handle_input = handle_input; | 1096 | dev->handle_input = handle_input; |
1095 | dev->name = name; | 1097 | dev->name = name; |
1098 | dev->vq = NULL; | ||
1096 | return dev; | 1099 | return dev; |
1097 | } | 1100 | } |
1098 | 1101 | ||