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

Commit ffa2d403 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ADSPRPC: Map and FD non-NULL check before dereferencing"

parents 0ee12051 5c96bedf
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1599,10 +1599,11 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
	PERF_END);
	for (i = bufs; i < bufs + handles; ++i) {
		struct fastrpc_mmap *map = ctx->maps[i];

		if (map) {
			pages[i].addr = map->phys;
			pages[i].size = map->size;
		}
	}
	fdlist = (uint64_t *)&pages[bufs + handles];
	for (i = 0; i < M_FDLIST; i++)
		fdlist[i] = 0;
@@ -1679,6 +1680,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
	}
	PERF_END);
	for (i = bufs; rpra && lrpra && i < bufs + handles; i++) {
		if (ctx->fds)
			rpra[i].dma.fd = lrpra[i].dma.fd = ctx->fds[i];
		rpra[i].dma.len = lrpra[i].dma.len = (uint32_t)lpra[i].buf.len;
		rpra[i].dma.offset = lrpra[i].dma.offset =