mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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:
parent
e536f19941
commit
3be974ce56
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue