From: Dan Carpenter Date: Mon, 11 Oct 2010 17:24:19 +0000 (+0200) Subject: vhost: fix return code for log_access_ok() X-Git-Tag: v2.6.37-rc1~147^2~2^2~3^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=6d97e55f7172303082850c1de085d06fc1e57d17;p=linux.git vhost: fix return code for log_access_ok() access_ok() returns 1 if it's OK otherwise it should return 0. Signed-off-by: Dan Carpenter Signed-off-by: Michael S. Tsirkin --- 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) /* Make sure 64 bit math will not overflow. */ if (a > ULONG_MAX - (unsigned long)log_base || a + (unsigned long)log_base > ULONG_MAX) - return -EFAULT; + return 0; return access_ok(VERIFY_WRITE, log_base + a, (sz + VHOST_PAGE_SIZE * 8 - 1) / VHOST_PAGE_SIZE / 8);