msm: kgsl: Improve robustness of snapshot and map frozen GPU objects
Improve the IB parser to be more robust when dealing with terribly
corrupted buffers. Also, make sure that the frozen GPU objects are
mapped in the kernel prior to being dumped.
Change-Id: Ic0dedbad49c52b9a41915ab36430770cb7b0025c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_snapshot.c b/drivers/gpu/msm/kgsl_snapshot.c
index 553dc60..3efafee 100644
--- a/drivers/gpu/msm/kgsl_snapshot.c
+++ b/drivers/gpu/msm/kgsl_snapshot.c
@@ -334,6 +334,12 @@
}
}
+ if (kgsl_memdesc_map(&entry->memdesc) == NULL) {
+ KGSL_DRV_ERR(device, "Unable to map GPU buffer %X\n",
+ gpuaddr);
+ return 0;
+ }
+
obj = kzalloc(sizeof(*obj), GFP_KERNEL);
if (obj == NULL) {