diff options
author | Dan Carpenter <error27@gmail.com> | 2010-10-11 13:24:19 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-10-12 08:32:28 -0400 |
commit | 6d97e55f7172303082850c1de085d06fc1e57d17 (patch) | |
tree | f1a309c0e0e4f4cd362adbd1cf4aca5d3a983535 /drivers/vhost | |
parent | b0057c51db66c5f0f38059f242c57d61c4741d89 (diff) |
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 <error27@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vhost.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dd3d6f7406f..158004e46e5 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); |