mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
virtio: Fix used_idx wrap-around
The more_used() function compares the vq->vring.used->idx with last_used_idx. Since vq->vring.used->idx is a 16-bit integer, and last_used_idx is an unsigned int, this results in unpredictable behavior when vq->vring.used->idx wraps around. This patch corrects this by changing last_used_idx to the correct type. Signed-off-by: Anthony Liguori <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
parent
4d125de3a5
commit
1bc4953ed4
1 changed files with 1 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ struct vring_virtqueue
|
|||
unsigned int num_added;
|
||||
|
||||
/* Last used index we've seen. */
|
||||
unsigned int last_used_idx;
|
||||
u16 last_used_idx;
|
||||
|
||||
/* How to notify other side. FIXME: commonalize hcalls! */
|
||||
void (*notify)(struct virtqueue *vq);
|
||||
|
|
|
|||
Loading…
Reference in a new issue