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

Commit e53fd03f authored by Vamsi Krishna Gattupalli's avatar Vamsi Krishna Gattupalli Committed by Gerrit - the friendly Code Review server
Browse files

msm: adsprpc: Use buf_get before ion apis



Use dma_buf_get to hold refcount such that buf will not
be freed till end.

Change-Id: Idab01a9081f197b780e8204dc21224e27090424f
Signed-off-by: default avatarVamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
parent 746d1a59
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -917,6 +917,9 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd,
				(unsigned int)map->attr);
			map->refs = 2;
		}
		VERIFY(err, !IS_ERR_OR_NULL(map->buf = dma_buf_get(fd)));
		if (err)
			goto bail;
		VERIFY(err, !IS_ERR_OR_NULL(map->handle =
				ion_import_dma_buf_fd(fl->apps->client, fd)));
		if (err)
@@ -947,9 +950,6 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd,
		if (map->attr & FASTRPC_ATTR_NOVA && !sess->smmu.coherent)
			map->uncached = 1;

		VERIFY(err, !IS_ERR_OR_NULL(map->buf = dma_buf_get(fd)));
		if (err)
			goto bail;
		VERIFY(err, !IS_ERR_OR_NULL(map->attach =
				dma_buf_attach(map->buf, sess->smmu.dev)));
		if (err)