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

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

Merge "char: virtio_fastrpc: Fix NULL pointer and uninitialized variable issue"

parents 1da94869 dfc18daf
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -547,7 +547,7 @@ static int virt_fastrpc_invoke(struct fastrpc_file *fl, uint32_t kernel,
	remote_arg_t *lpra = NULL;
	struct virt_fastrpc_buf *rpra;
	struct virt_fastrpc_dmahandle *handle;
	uint64_t *fdlist;
	uint64_t *fdlist = NULL;
	int *fds, outbufs_offset = 0;
	unsigned int *attrs;
	struct fastrpc_mmap **maps, *mmap = NULL;
@@ -754,7 +754,7 @@ static int virt_fastrpc_invoke(struct fastrpc_file *fl, uint32_t kernel,
		struct scatterlist *sgl = NULL;
		int index = 0, hlist;

		if (maps[i]) {
		if (fds && maps[i]) {
			/* fill in dma handle list */
			hlist = i - bufs;
			handle[hlist].fd = fds[i];
@@ -837,7 +837,7 @@ static int virt_fastrpc_invoke(struct fastrpc_file *fl, uint32_t kernel,
	for (i = 0; i < bufs; i++)
		fastrpc_mmap_free(maps[i], 0);

	if (total) {
	if (total && fdlist) {
		for (i = 0; i < M_FDLIST; i++) {
			if (!fdlist[i])
				break;
@@ -947,7 +947,7 @@ static const struct file_operations debugfs_fops = {
	.read = fastrpc_debugfs_read,
};

static inline void fastprc_free_pages(struct page **pages, int count)
static inline void fastrpc_free_pages(struct page **pages, int count)
{
	while (count--)
		__free_page(pages[count]);
@@ -1000,7 +1000,7 @@ static struct page **fastrpc_alloc_pages(unsigned int count, gfp_t gfp)
			__free_pages(page, order);
		}
		if (!page) {
			fastprc_free_pages(pages, i);
			fastrpc_free_pages(pages, i);
			return NULL;
		}
		count -= order_size;
@@ -1034,7 +1034,7 @@ static struct page **fastrpc_alloc_buffer(struct fastrpc_buf *buf, gfp_t gfp)
out_free_sg:
	sg_free_table(&buf->sgt);
out_free_pages:
	fastprc_free_pages(pages, count);
	fastrpc_free_pages(pages, count);
	return NULL;
}

@@ -1044,7 +1044,7 @@ static inline void fastrpc_free_buffer(struct fastrpc_buf *buf)

	vunmap(buf->va);
	sg_free_table(&buf->sgt);
	fastprc_free_pages(buf->pages, count);
	fastrpc_free_pages(buf->pages, count);
}

static void fastrpc_buf_free(struct fastrpc_buf *buf, int cache)
@@ -1436,9 +1436,6 @@ static int fastrpc_internal_munmap_fd(struct fastrpc_file *fl,
	struct fastrpc_apps *me = fl->apps;
	struct fastrpc_mmap *map = NULL;

	VERIFY(err, (fl && ud));
	if (err)
		goto bail;
	VERIFY(err, fl->dsp_proc_init == 1);
	if (err) {
		dev_err(me->dev, "%s: user application %s trying to unmap without initialization\n",