msm: kgsl: Return error code when ION setup fails

ion_import_dma_buf() can return a NULL without an error code. Detect
this condition & return a -EINVAL as error.

Change-Id: I18d058fd374a8d00c00bb943f496f446c9f1c90d
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
This commit is contained in:
Ranjhith Kalisamy 2012-08-14 19:49:39 +05:30 committed by Stephen Boyd
parent e536f19941
commit 3be974ce56

View file

@ -1786,8 +1786,10 @@ static int kgsl_setup_ion(struct kgsl_mem_entry *entry,
return -ENODEV;
handle = ion_import_dma_buf(kgsl_ion_client, fd);
if (IS_ERR_OR_NULL(handle))
if (IS_ERR(handle))
return PTR_ERR(handle);
else if (!handle)
return -EINVAL;
entry->memtype = KGSL_MEM_ENTRY_ION;
entry->priv_data = handle;