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

Commit c2641eec authored by Deepak Kumar's avatar Deepak Kumar Committed by Akhil P Oommen
Browse files

msm: kgsl: Access map_count only if entry is successfully allocated



In kgsl_mem_entry_create, access map_count only if entry is allocated
successfully to avoid invalid access.

Change-Id: I57bce1aec2da6a27b6d13dbee96ed86a45c9660c
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
Signed-off-by: default avatarAkhil P Oommen <akhilpo@codeaurora.org>
parent 2d27b92b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -263,9 +263,9 @@ kgsl_mem_entry_create(void)
		kref_init(&entry->refcount);
		/* put this ref in userspace memory alloc and map ioctls */
		kref_get(&entry->refcount);
		atomic_set(&entry->map_count, 0);
	}

	atomic_set(&entry->map_count, 0);
	return entry;
}
#ifdef CONFIG_DMA_SHARED_BUFFER