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

Commit f6f0bf15 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: adsprpc: return proper error code while getting device info



Return a different error code when a non-secure fastrpc device
node has been configured as a secure channel to avoid conflicts
with other failures. Set virtual address of remote buffers to
NULL before mapping them on DSP.

Change-Id: I8b3547e2dabd88b70d69ab0cb6b35514fc697936
Acked-by: default avatarThyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 47cb4b24
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2035,6 +2035,7 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
						DMA_ATTR_NO_KERNEL_MAPPING |
						DMA_ATTR_FORCE_NON_COHERENT;
		err = fastrpc_buf_alloc(fl, memlen, imem_dma_attr, 0, 0, &imem);
		imem->virt = NULL;
		if (err)
			goto bail;
		fl->init_mem = imem;
@@ -2576,6 +2577,7 @@ static int fastrpc_internal_mmap(struct fastrpc_file *fl,
								1, &rbuf);
		if (err)
			goto bail;
		rbuf->virt = NULL;
		err = fastrpc_mmap_on_dsp(fl, ud->flags,
				(uintptr_t)rbuf->virt,
				rbuf->phys, rbuf->size, &raddr);
@@ -3092,7 +3094,7 @@ static int fastrpc_get_info(struct fastrpc_file *fl, uint32_t *info)
			 * invoke any other methods without failure
			 */
			if (fl->apps->channel[cid].secure == SECURE_CHANNEL) {
				err = -EPERM;
				err = -EACCES;
				goto bail;
			}
		}