projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73a99f0
)
vhost: fix get_user_pages_fast error handling
author
Michael S. Tsirkin
<mst@redhat.com>
Tue, 23 Feb 2010 09:25:23 +0000
(11:25 +0200)
committer
Michael S. Tsirkin
<mst@redhat.com>
Sun, 28 Feb 2010 17:42:36 +0000
(19:42 +0200)
get_user_pages_fast returns number of pages on success, negative value
on failure, but never 0. Fix vhost code to match this logic.
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vhost.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/vhost/vhost.c
b/drivers/vhost/vhost.c
index 6c31c0c9bbb9fb315d76ea807073eb8526648e3a..7cd55e07879455abe95e04fa06656623b415c9a9 100644
(file)
--- a/
drivers/vhost/vhost.c
+++ b/
drivers/vhost/vhost.c
@@
-646,8
+646,9
@@
static int set_bit_to_user(int nr, void __user *addr)
int bit = nr + (log % PAGE_SIZE) * 8;
int r;
r = get_user_pages_fast(log, 1, 1, &page);
- if (r)
+ if (r
< 0
)
return r;
+ BUG_ON(r != 1);
base = kmap_atomic(page, KM_USER0);
set_bit(bit, base);
kunmap_atomic(base, KM_USER0);