[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100407135910.GA18268@c-98-229-117-200.hsd1.ma.comcast.net>
Date: Wed, 7 Apr 2010 09:59:10 -0400
From: Jeff Dike <jdike@...toit.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: "Xin, Xiaohui" <xiaohui.xin@...el.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix vq_memory_access_ok error checking
On Wed, Apr 07, 2010 at 10:49:07AM +0300, Michael S. Tsirkin wrote:
> Thanks!
> Can you add a Signed-off-by line?
Oops, I was in a hurry...
commit 7938779d9f357ede8bc3c122fd0dc9d5ec4fcf1d
Author: Jeff Dike <jdike@...toit.com>
Date: Wed Mar 31 15:05:08 2010 -0400
vq_memory_access_ok needs to check whether mem == NULL
Signed-off-by: Jeff Dike <jdike@...ux.intel.com>
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 7bd7a1e..b8e1127 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists