diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index e1ad9354c85a158c62bbc320d74767f14b57607d..efc4c69210a0f37d0fd3f2e0dcf925268f57380a 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -2912,6 +2912,9 @@ error_attach:
break;
}
error:
+ /* Clear gpuaddr here so userspace doesn't get any wrong ideas */
+ param->gpuaddr = 0;
+
kfree(entry);
return result;
}
diff --git a/drivers/gpu/msm/kgsl_sharedmem.c b/drivers/gpu/msm/kgsl_sharedmem.c
index 5d4fc0088c99104361be578943e835154e81c5c6..9fd10c751b6d79b21a0ee50fd73be1ba478ad7cd 100755
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
@@ -527,8 +527,7 @@ static void kgsl_cma_coherent_free(struct kgsl_memdesc *memdesc)
/* Global - also used by kgsl_drm.c */
struct kgsl_memdesc_ops kgsl_page_alloc_ops = {
.free = kgsl_page_alloc_free,
- .vmflags = VM_IO | VM_DONTEXPAND,
- //.vmflags = VM_RESERVED | VM_DONTEXPAND,
+ .vmflags = VM_NODUMP | VM_DONTEXPAND,
.vmfault = kgsl_page_alloc_vmfault,
.map_kernel = kgsl_page_alloc_map_kernel,
.unmap_kernel = kgsl_page_alloc_unmap_kernel,
@@ -538,8 +537,7 @@ EXPORT_SYMBOL(kgsl_page_alloc_ops);
/* CMA ops - used during NOMMU mode */
static struct kgsl_memdesc_ops kgsl_cma_ops = {
.free = kgsl_cma_coherent_free,
- .vmflags = VM_IO | VM_PFNMAP | VM_DONTEXPAND,
- //.vmflags = VM_RESERVED | VM_PFNMAP | VM_DONTEXPAND,
+ .vmflags = VM_NODUMP | VM_PFNMAP | VM_DONTEXPAND,
.vmfault = kgsl_contiguous_vmfault,
};