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

Commit 4b905db5 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Fix the snapshot mempool size calculation



The snapshot mempool size takes into account the memory
required for section headers. It was being calculated based
on old header structure. Update that to avoid corruption/
buffer overflow of the mempool memory.

Change-Id: I07274934e4c0dced707e03be3e31b2459e00d706
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 5f838c4f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, 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
@@ -1027,7 +1027,7 @@ void kgsl_snapshot_save_frozen_objs(struct work_struct *work)
		obj->size = ALIGN(obj->size, 4);

		size += ((size_t) obj->size +
			sizeof(struct kgsl_snapshot_gpu_object) +
			sizeof(struct kgsl_snapshot_gpu_object_v2) +
			sizeof(struct kgsl_snapshot_section_header));
	}