Skip to content

Commit e0136c1

Browse files
Zhu Lingshanmstsirkin
authored andcommitted
vhost: replace -1 with VHOST_FILE_UNBIND in ioctls
This commit replaces -1 with VHOST_FILE_UNBIND in ioctls since we have added such a macro in the uapi header for vdpa_host. Signed-off-by: Zhu Lingshan <[email protected]> Acked-by: Jason Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 776f395 commit e0136c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/vhost/vhost.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg
16121612
r = -EFAULT;
16131613
break;
16141614
}
1615-
eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd);
1615+
eventfp = f.fd == VHOST_FILE_UNBIND ? NULL : eventfd_fget(f.fd);
16161616
if (IS_ERR(eventfp)) {
16171617
r = PTR_ERR(eventfp);
16181618
break;
@@ -1628,7 +1628,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg
16281628
r = -EFAULT;
16291629
break;
16301630
}
1631-
ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd);
1631+
ctx = f.fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(f.fd);
16321632
if (IS_ERR(ctx)) {
16331633
r = PTR_ERR(ctx);
16341634
break;
@@ -1640,7 +1640,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg
16401640
r = -EFAULT;
16411641
break;
16421642
}
1643-
ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd);
1643+
ctx = f.fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(f.fd);
16441644
if (IS_ERR(ctx)) {
16451645
r = PTR_ERR(ctx);
16461646
break;
@@ -1765,7 +1765,7 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
17651765
r = get_user(fd, (int __user *)argp);
17661766
if (r < 0)
17671767
break;
1768-
ctx = fd == -1 ? NULL : eventfd_ctx_fdget(fd);
1768+
ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd);
17691769
if (IS_ERR(ctx)) {
17701770
r = PTR_ERR(ctx);
17711771
break;

0 commit comments

Comments
 (0)