Skip to content

Commit 1b0be99

Browse files
committed
vhost: missing __user tags
sparse warns about converting void * to void __user *. This is not new but only got noticed now that vhost is built on more systems. This is just a question of __user tags missing in a couple of places, so fix it up. Fixes: f889491 ("vhost: introduce O(1) vq metadata cache") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 0f8e382 commit 1b0be99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/vhost/vhost.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ static inline void __user *vhost_vq_meta_fetch(struct vhost_virtqueue *vq,
730730
if (!map)
731731
return NULL;
732732

733-
return (void *)(uintptr_t)(map->addr + addr - map->start);
733+
return (void __user *)(uintptr_t)(map->addr + addr - map->start);
734734
}
735735

736736
/* Can we switch to this memory table? */
@@ -869,7 +869,7 @@ static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq,
869869
* not happen in this case.
870870
*/
871871
static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq,
872-
void *addr, unsigned int size,
872+
void __user *addr, unsigned int size,
873873
int type)
874874
{
875875
void __user *uaddr = vhost_vq_meta_fetch(vq,

0 commit comments

Comments
 (0)