diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-16 10:10:52 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-16 10:10:52 +0200 |
commit | 18a818c5933952c404d6e4ce26d2df3109852313 (patch) | |
tree | 4e2df679d3c62825f5523cf14589a6ce573ae6d7 | |
parent | 5e19ec80e1834a56303bf494fe97c01883f2002e (diff) | |
download | queue-3.18-18a818c5933952c404d6e4ce26d2df3109852313.tar.gz |
fix patch
-rw-r--r-- | vhost-make-sure-log_num-in_num.patch | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/vhost-make-sure-log_num-in_num.patch b/vhost-make-sure-log_num-in_num.patch index 8e10b22..3057584 100644 --- a/vhost-make-sure-log_num-in_num.patch +++ b/vhost-make-sure-log_num-in_num.patch @@ -28,25 +28,27 @@ Reviewed-by: Tyler Hicks <tyhicks@canonical.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c -index 34ea219936e3..acabf20b069e 100644 +--- + drivers/vhost/vhost.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c -@@ -2180,7 +2180,7 @@ static int get_indirect(struct vhost_virtqueue *vq, +@@ -1174,7 +1174,7 @@ static int get_indirect(struct vhost_vir /* If this is an input descriptor, increment that count. */ - if (access == VHOST_ACCESS_WO) { + if (desc.flags & VRING_DESC_F_WRITE) { *in_num += ret; - if (unlikely(log)) { + if (unlikely(log && ret)) { - log[*log_num].addr = vhost64_to_cpu(vq, desc.addr); - log[*log_num].len = vhost32_to_cpu(vq, desc.len); + log[*log_num].addr = desc.addr; + log[*log_num].len = desc.len; ++*log_num; -@@ -2321,7 +2321,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, +@@ -1297,7 +1297,7 @@ int vhost_get_vq_desc(struct vhost_virtq /* If this is an input descriptor, * increment that count. */ *in_num += ret; - if (unlikely(log)) { + if (unlikely(log && ret)) { - log[*log_num].addr = vhost64_to_cpu(vq, desc.addr); - log[*log_num].len = vhost32_to_cpu(vq, desc.len); + log[*log_num].addr = desc.addr; + log[*log_num].len = desc.len; ++*log_num; |