summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-04-08 01:52:29 +0200
committerDavid S. Miller <davem@davemloft.net>2010-04-08 01:52:29 +0200
commit04b1a22350e1e6464c3109886385178d119dbbb4 (patch)
treebea1d2d0f8692c82ccf9b9c727436fe9ddaa1531
parentqlcnic: fix set mac addr (diff)
parentvhost-net: fix vq_memory_access_ok error checking (diff)
downloadlinux-04b1a22350e1e6464c3109886385178d119dbbb4.tar.xz
linux-04b1a22350e1e6464c3109886385178d119dbbb4.zip
Merge branch 'vhost' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
-rw-r--r--drivers/vhost/vhost.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 7bd7a1e4409d..b8e112720812 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -235,6 +235,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;