Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd48b0a1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add missing check for snapshot IB dump"

parents 2f5e49a2 1379d118
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -70,6 +70,19 @@ void kgsl_snapshot_push_object(struct kgsl_process_private *process,
	for (index = 0; index < objbufptr; index++) {
		if (objbuf[index].gpuaddr == gpuaddr &&
			objbuf[index].entry->priv == process) {
			/*
			 * Check if newly requested size is within the
			 * allocated range or not, otherwise continue
			 * with previous size.
			 */
			if (!kgsl_gpuaddr_in_memdesc(
				&objbuf[index].entry->memdesc,
				gpuaddr, dwords << 2)) {
				KGSL_CORE_ERR(
					"snapshot: IB 0x%016llx size is not within the memdesc range\n",
					gpuaddr);
				return;
			}

			objbuf[index].size = max_t(uint64_t,
						objbuf[index].size,