soc: qcom: spcom: lock ion buf, decrement ref count if no free entry

spcom_handle_lock_ion_buf_command() should decrement ref count,
that is incremented by ion_import_dma_buf().

Change-Id: Ic7f814bd2791b4dbcf6356f64ad32ee85c6cb103
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
This commit is contained in:
Amir Samuelov 2017-03-24 11:37:35 +03:00 committed by Gerrit - the friendly Code Review server
parent ba53c4518c
commit 618dde7de1

View file

@ -1744,7 +1744,9 @@ static int spcom_handle_lock_ion_buf_command(struct spcom_channel *ch,
} }
} }
pr_err("fd [%d] ion buf not found.\n", fd); pr_err("no free entry to store ion handle of fd [%d].\n", fd);
/* decrement back the ref count */
ion_free(spcom_dev->ion_client, ion_handle);
return -EFAULT; return -EFAULT;
} }