@@ -286,11 +286,11 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EOPNOTSUPP;
break;
}
- if ((u64)(long)a.user_addr != a.user_addr) {
+ if ((u64)(unsigned long)a.user_addr != a.user_addr) {
r = -EFAULT;
break;
}
- vq->desc = (void __user *)(long)a.user_addr;
+ vq->desc = (void __user *)(unsigned long)a.user_addr;
break;
case VHOST_SET_VRING_AVAIL:
r = copy_from_user(&a, argp, sizeof a);
@@ -300,11 +300,11 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EOPNOTSUPP;
break;
}
- if ((u64)(long)a.user_addr != a.user_addr) {
+ if ((u64)(unsigned long)a.user_addr != a.user_addr) {
r = -EFAULT;
break;
}
- vq->avail = (void __user *)(long)a.user_addr;
+ vq->avail = (void __user *)(unsigned long)a.user_addr;
/* Forget the cached index value. */
vq->avail_idx = vq->last_avail_idx;
break;
@@ -316,11 +316,11 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EOPNOTSUPP;
break;
}
- if ((u64)(long)a.user_addr != a.user_addr) {
+ if ((u64)(unsigned long)a.user_addr != a.user_addr) {
r = -EFAULT;
break;
}
- vq->used = (void __user *)(long)a.user_addr;
+ vq->used = (void __user *)(unsigned long)a.user_addr;
r = init_used(vq);
if (r)
break;
@@ -389,7 +389,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
if (pollstop && vq->handle_kick)
vhost_poll_flush(&vq->poll);
- return 0;
+ return r;
}
long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, unsigned long arg)