diff options
author | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-04-26 21:56:19 +0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-04-26 21:56:19 +0400 |
commit | 8ef1bb539203629f77a61976e4f25415e1083bff (patch) | |
tree | 4fee25aca0928f112716fb02d27b1b355d0843b4 /drivers/vhost | |
parent | a3bcbbee83f55cbaec9b2ad748e7300c7feb2192 (diff) | |
parent | b91ce4d14a21fc04d165be30319541e0f9204f15 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 1 | ||||
-rw-r--r-- | drivers/vhost/vhost.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index a6a88dfd502..9777583218f 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -17,6 +17,7 @@ #include <linux/workqueue.h> #include <linux/rcupdate.h> #include <linux/file.h> +#include <linux/slab.h> #include <linux/net.h> #include <linux/if_packet.h> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 7bd7a1e4409..e69d238c5af 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -22,6 +22,7 @@ #include <linux/poll.h> #include <linux/file.h> #include <linux/highmem.h> +#include <linux/slab.h> #include <linux/net.h> #include <linux/if_packet.h> @@ -235,6 +236,10 @@ static int vq_memory_access_ok(void __user *log_base, struct vhost_memory *mem, int log_all) { int i; + + if (!mem) + return 0; + for (i = 0; i < mem->nregions; ++i) { struct vhost_memory_region *m = mem->regions + i; unsigned long a = m->userspace_addr; |