提交 179b284e 编写于 作者: J Jeff Dike 提交者: Michael S. Tsirkin

vhost-net: fix vq_memory_access_ok error checking

vq_memory_access_ok needs to check whether mem == NULL
Signed-off-by: NJeff Dike <jdike@linux.intel.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 535297a6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册