msm: ocmem: Create ocmem_region when memory is available.

The ocmem_region structure must not be created if the
ocmem request from the client cannot be allocated at all.
Otherwise the memory corresponding to the ocmem_region might
never be freed if the requesting client calls ocmem_free()
before receiving the allocation. This might lead to a memory
leak.

CRs-Fixed: 492929
Change-Id: I18ddb5ff5a4f8208a75db2eacb602c8c070cd990
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
1 file changed