msm: kgsl: Skip some gmu global memory dump to snapshot

Gmu global such as ipc core memdesc is not mapped to host.
Skip these kind of gmu global memdesc dumping to snapshot
to avoid null pointer dereference.

Change-Id: Idba9168e854430253624629ed45826015773148f
Signed-off-by: Hareesh Gundu <quic_hareeshg@quicinc.com>
This commit is contained in:
Hareesh Gundu 2021-12-29 12:20:00 +05:30 committed by Lynus Vaz
parent bf55be9e52
commit 60a637c337
2 changed files with 4 additions and 1 deletions

View File

@ -156,7 +156,7 @@ static size_t a6xx_snapshot_gmu_mem(struct kgsl_device *device,
(buf + sizeof(*mem_hdr));
struct gmu_mem_type_desc *desc = priv;
if (priv == NULL)
if (priv == NULL || desc->memdesc->hostptr == NULL)
return 0;
if (remain < desc->memdesc->size + sizeof(*mem_hdr)) {

View File

@ -87,6 +87,9 @@ static size_t gen7_snapshot_gmu_mem(struct kgsl_device *device,
(buf + sizeof(*mem_hdr));
struct gmu_mem_type_desc *desc = priv;
if (priv == NULL || desc->memdesc->hostptr == NULL)
return 0;
if (remain < desc->memdesc->size + sizeof(*mem_hdr)) {
dev_err(device->dev,
"snapshot: Not enough memory for the gmu section %d\n",