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

Commit b6465ddd authored by Sathish Ambley's avatar Sathish Ambley
Browse files

msm: ADSPRPC: Skip file mapping for static shell



Do not map buffer if the file length is passed as
zero from user space for static shell linking use cases.

Change-Id: I992f22e12e88d2f019dfb646987ec7eaeb5ab40c
Acked-by: default avatarHimateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: default avatarSathish Ambley <sathishambley@codeaurora.org>
parent fcbbe260
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1381,10 +1381,12 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		inbuf.pgid = current->tgid;
		inbuf.namelen = strlen(current->comm) + 1;
		inbuf.filelen = init->filelen;
		VERIFY(err, !fastrpc_mmap_create(fl, init->filefd, init->file,
					init->filelen, mflags, &file));
		if (init->filelen) {
			VERIFY(err, !fastrpc_mmap_create(fl, init->filefd,
				init->file, init->filelen, mflags, &file));
			if (err)
				goto bail;
		}
		inbuf.pageslen = 1;
		VERIFY(err, !fastrpc_mmap_create(fl, init->memfd, init->mem,
					init->memlen, mflags, &mem));