aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/vhost/vhost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index dd3d6f7406f8..158004e46e56 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -371,7 +371,7 @@ static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)
371 /* Make sure 64 bit math will not overflow. */ 371 /* Make sure 64 bit math will not overflow. */
372 if (a > ULONG_MAX - (unsigned long)log_base || 372 if (a > ULONG_MAX - (unsigned long)log_base ||
373 a + (unsigned long)log_base > ULONG_MAX) 373 a + (unsigned long)log_base > ULONG_MAX)
374 return -EFAULT; 374 return 0;
375 375
376 return access_ok(VERIFY_WRITE, log_base + a, 376 return access_ok(VERIFY_WRITE, log_base + a,
377 (sz + VHOST_PAGE_SIZE * 8 - 1) / VHOST_PAGE_SIZE / 8); 377 (sz + VHOST_PAGE_SIZE * 8 - 1) / VHOST_PAGE_SIZE / 8);