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: Deepak Kumar <dkumar@codeaurora.org>
This commit is contained in:
Deepak Kumar 2021-02-19 23:35:25 +05:30
commit cfc73b1e63

View file

@ -252,9 +252,9 @@ static struct kgsl_mem_entry *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;
}