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

Commit e3ffb4ca authored by Carter Cooper's avatar Carter Cooper
Browse files

msm: kgsl: Fix range checking for profile wrapping



There is a chance that the profile code will not wrap correctly.
This can cause the in stream profiling to cause buffer pre-run
or undershoot (accessing data before the buffer). Fix logic to
cause the correct wrapping.

Change-Id: I9aa68228ff5be1bd26ee1cf1a486859346a8027f
CRs-Fixed: 585754
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent 482daedc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1089,7 +1089,7 @@ void adreno_profile_preib_processing(struct kgsl_device *device,
	if (SIZE_SHARED_ENTRY(count) >= shared_buf_available(profile))
		goto done;

	if (entry_head + SIZE_SHARED_ENTRY(count) > profile->shared_size) {
	if (entry_head + SIZE_SHARED_ENTRY(count) >= profile->shared_size) {
		/* entry_head would wrap, start entry_head at 0 in buffer */
		entry_head = 0;
		profile->shared_size = profile->shared_head;