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

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

Merge "msm: adsprpc: Check for valid error returned from mini dump"

parents dd1bed2e f6803cc3
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -897,7 +897,7 @@ static inline void reset_unique_index(int index)
 */
static int fastrpc_minidump_add_region(struct fastrpc_mmap *map)
{
	int err = -1, md_index = 0;
	int err = 0, ret_val = 0, md_index = 0;
	struct md_region md_entry;

	md_index = get_unique_index();
@@ -906,19 +906,20 @@ static int fastrpc_minidump_add_region(struct fastrpc_mmap *map)
		md_entry.virt_addr = map->va;
		md_entry.phys_addr = map->phys;
		md_entry.size = map->size;
		err = msm_minidump_add_region(&md_entry);
		if (err < 0) {
		ret_val = msm_minidump_add_region(&md_entry);
		if (ret_val < 0) {
			ADSPRPC_ERR(
			"Failed to add/update CMA to Minidump for phys: 0x%llx, size: %zu, md_index %d, md_entry.name %s\n",
			map->phys,
			map->size, md_index,
			md_entry.name);
			reset_unique_index(md_index);
			err = ret_val;
		} else {
			map->frpc_md_index = md_index;
		}
	} else {
		ADSPRPC_ERR("failed to generate valid unique id for mini dump : %d\n", md_index);
		pr_warn("failed to generate valid unique id for mini dump : %d\n", md_index);
	}
	return err;
}
@@ -3738,7 +3739,7 @@ static int fastrpc_init_create_dynamic_process(struct fastrpc_file *fl,
static int fastrpc_init_create_static_process(struct fastrpc_file *fl,
				struct fastrpc_ioctl_init *init)
{
	int err = 0, rh_hyp_done = 0, mem_create = 0;
	int err = 0, rh_hyp_done = 0;
	struct fastrpc_apps *me = &gfa;
	struct fastrpc_ioctl_invoke_async ioctl;
	struct smq_phy_page pages[1];
@@ -3795,7 +3796,6 @@ static int fastrpc_init_create_static_process(struct fastrpc_file *fl,
		mutex_unlock(&fl->map_mutex);
		if (err)
			goto bail;
		mem_create = 1;
		phys = mem->phys;
		size = mem->size;
		/*
@@ -3865,12 +3865,10 @@ static int fastrpc_init_create_static_process(struct fastrpc_file *fl,
					"rh hyp unassign failed with %d for phys 0x%llx of size %zu\n",
					hyp_err, phys, size);
		}
		if (mem_create && mem) {
	mutex_lock(&fl->map_mutex);
	fastrpc_mmap_free(mem, 0);
	mutex_unlock(&fl->map_mutex);
	}
	}
	return err;
}