diff options
| -rw-r--r-- | tools/lguest/lguest.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index 80dc6346030e..990671e61f87 100644 --- a/tools/lguest/lguest.c +++ b/tools/lguest/lguest.c | |||
| @@ -769,20 +769,21 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq, | |||
| 769 | * that: no rmb() required. | 769 | * that: no rmb() required. |
| 770 | */ | 770 | */ |
| 771 | 771 | ||
| 772 | /* | 772 | do { |
| 773 | * If this is an indirect entry, then this buffer contains a descriptor | 773 | /* |
| 774 | * table which we handle as if it's any normal descriptor chain. | 774 | * If this is an indirect entry, then this buffer contains a |
| 775 | */ | 775 | * descriptor table which we handle as if it's any normal |
| 776 | if (desc[i].flags & VRING_DESC_F_INDIRECT) { | 776 | * descriptor chain. |
| 777 | if (desc[i].len % sizeof(struct vring_desc)) | 777 | */ |
| 778 | errx(1, "Invalid size for indirect buffer table"); | 778 | if (desc[i].flags & VRING_DESC_F_INDIRECT) { |
| 779 | if (desc[i].len % sizeof(struct vring_desc)) | ||
| 780 | errx(1, "Invalid size for indirect buffer table"); | ||
| 779 | 781 | ||
| 780 | max = desc[i].len / sizeof(struct vring_desc); | 782 | max = desc[i].len / sizeof(struct vring_desc); |
| 781 | desc = check_pointer(desc[i].addr, desc[i].len); | 783 | desc = check_pointer(desc[i].addr, desc[i].len); |
| 782 | i = 0; | 784 | i = 0; |
| 783 | } | 785 | } |
| 784 | 786 | ||
| 785 | do { | ||
| 786 | /* Grab the first descriptor, and check it's OK. */ | 787 | /* Grab the first descriptor, and check it's OK. */ |
| 787 | iov[*out_num + *in_num].iov_len = desc[i].len; | 788 | iov[*out_num + *in_num].iov_len = desc[i].len; |
| 788 | iov[*out_num + *in_num].iov_base | 789 | iov[*out_num + *in_num].iov_base |
