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: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
Harshdeep Dhatt 2016-01-13 16:16:04 -07:00 committed by David Keitel
parent b131172459
commit e34ca145b3

View file

@ -1,4 +1,4 @@
/* 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 * 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 * 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); obj->size = ALIGN(obj->size, 4);
size += ((size_t) obj->size + size += ((size_t) obj->size +
sizeof(struct kgsl_snapshot_gpu_object) + sizeof(struct kgsl_snapshot_gpu_object_v2) +
sizeof(struct kgsl_snapshot_section_header)); sizeof(struct kgsl_snapshot_section_header));
} }