Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 274a96e4 authored by Shalini Krishnamoorthi's avatar Shalini Krishnamoorthi
Browse files

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: default avatarShalini Krishnamoorthi <shakri@codeaurora.org>
parent 97baa9ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1010,7 +1010,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;