Samsung VZW MB1 update
/drivers/media/video/msm/wfd/wfd-ioctl.c
blob:bf7713427883e048061ff140246c92243519d894 -> blob:d2b0a9f98c89c35b09709438e5f7e500b04748a9
--- drivers/media/video/msm/wfd/wfd-ioctl.c
+++ drivers/media/video/msm/wfd/wfd-ioctl.c
@@ -148,7 +148,7 @@ static int wfd_allocate_ion_buffer(struc
bool secure, struct mem_region *mregion)
{
struct ion_handle *handle;
- void *kvaddr, *phys_addr;
+ void *kvaddr = NULL, *phys_addr = NULL;
unsigned long size;
unsigned int alloc_regions = 0;
int rc;
@@ -194,7 +194,9 @@ static int wfd_allocate_ion_buffer(struc
return rc;
alloc_fail:
if (!IS_ERR_OR_NULL(handle)) {
- ion_unmap_kernel(client, handle);
+ if (!IS_ERR_OR_NULL(kvaddr))
+ ion_unmap_kernel(client, handle);
+
ion_free(client, handle);
mregion->kvaddr = NULL;