msm: mdss: Add null check for dma buffer memory

The dma buffer is checked only for error and not null. Changes
are added to check if the buffer is null to prevent accessing
invalid MUTEX lock or invalid dma buffer memory.

CRs-Fixed: 1032180
Change-Id: Ia1ed1238b084d04eb787d078f7bb47a4e2a62a8a
Signed-off-by: Shalini Krishnamoorthi <shakri@codeaurora.org>
This commit is contained in:
Shalini Krishnamoorthi 2016-06-21 15:50:05 -07:00 committed by Harsh Sahu
parent 4ba1744f2e
commit 665a666fc7

View file

@ -1027,7 +1027,7 @@ static int mdss_mdp_get_img(struct msmfb_data *img,
} else if (iclient) {
if (mdss_mdp_is_map_needed(mdata, data)) {
data->srcp_dma_buf = dma_buf_get(img->memory_id);
if (IS_ERR(data->srcp_dma_buf)) {
if (IS_ERR_OR_NULL(data->srcp_dma_buf)) {
pr_err("error on ion_import_fd\n");
ret = PTR_ERR(data->srcp_dma_buf);
data->srcp_dma_buf = NULL;