Unverified Commit 3e163a9e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11120 misc: fastrpc: Don't remove map on creater_process and device_release

parents 7efb6037 53e12f26
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -247,6 +247,13 @@ static void fastrpc_free_map(struct kref *ref)
		dma_buf_put(map->buf);
	}

	if (map->fl) {
		spin_lock(&map->fl->lock);
		list_del(&map->node);
		spin_unlock(&map->fl->lock);
		map->fl = NULL;
	}

	kfree(map);
}

@@ -1112,12 +1119,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
	fl->init_mem = NULL;
	fastrpc_buf_free(imem);
err_alloc:
	if (map) {
		spin_lock(&fl->lock);
		list_del(&map->node);
		spin_unlock(&fl->lock);
	fastrpc_map_put(map);
	}
err:
	kfree(args);

@@ -1194,10 +1196,8 @@ static int fastrpc_device_release(struct inode *inode, struct file *file)
		fastrpc_context_put(ctx);
	}

	list_for_each_entry_safe(map, m, &fl->maps, node) {
		list_del(&map->node);
	list_for_each_entry_safe(map, m, &fl->maps, node)
		fastrpc_map_put(map);
	}

	list_for_each_entry_safe(buf, b, &fl->mmaps, node) {
		list_del(&buf->node);