Skip to content

Commit fea0691

Browse files
committed
Merge branch 'vhost' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
2 parents 5f6c018 + a8d3782 commit fea0691

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

drivers/vhost/net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static struct miscdevice vhost_net_misc = {
642642
&vhost_net_fops,
643643
};
644644

645-
int vhost_net_init(void)
645+
static int vhost_net_init(void)
646646
{
647647
int r = vhost_init();
648648
if (r)
@@ -659,7 +659,7 @@ int vhost_net_init(void)
659659
}
660660
module_init(vhost_net_init);
661661

662-
void vhost_net_exit(void)
662+
static void vhost_net_exit(void)
663663
{
664664
misc_deregister(&vhost_net_misc);
665665
vhost_cleanup();

drivers/vhost/vhost.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,8 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
715715
return 0;
716716
}
717717

718-
int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
719-
struct iovec iov[], int iov_size)
718+
static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
719+
struct iovec iov[], int iov_size)
720720
{
721721
const struct vhost_memory_region *reg;
722722
struct vhost_memory *mem;
@@ -741,7 +741,7 @@ int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
741741
_iov = iov + ret;
742742
size = reg->memory_size - addr + reg->guest_phys_addr;
743743
_iov->iov_len = min((u64)len, size);
744-
_iov->iov_base = (void *)(unsigned long)
744+
_iov->iov_base = (void __user *)(unsigned long)
745745
(reg->userspace_addr + addr - reg->guest_phys_addr);
746746
s += size;
747747
addr += size;
@@ -995,7 +995,7 @@ void vhost_discard_vq_desc(struct vhost_virtqueue *vq)
995995
* want to notify the guest, using eventfd. */
996996
int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len)
997997
{
998-
struct vring_used_elem *used;
998+
struct vring_used_elem __user *used;
999999

10001000
/* The virtqueue contains a ring of used buffers. Get a pointer to the
10011001
* next entry in that used ring. */
@@ -1019,7 +1019,8 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len)
10191019
smp_wmb();
10201020
/* Log used ring entry write. */
10211021
log_write(vq->log_base,
1022-
vq->log_addr + ((void *)used - (void *)vq->used),
1022+
vq->log_addr +
1023+
((void __user *)used - (void __user *)vq->used),
10231024
sizeof *used);
10241025
/* Log used index update. */
10251026
log_write(vq->log_base,

0 commit comments

Comments
 (0)