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

Commit 51dd9dff authored by Ben Romberger's avatar Ben Romberger
Browse files

ASoC: msm: qdsp6v2: Check memory before re-mapping calibration block



Check that the memory was correctly allocated
for the calibration block before re-mapping
the calibration block to the ADSP.

Change-Id: I7b1cb2cc2c04c9064788b5778ca3f2798e642efe
Signed-off-by: default avatarBen Romberger <bromberg@codeaurora.org>
parent f81d0b1f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -665,6 +665,7 @@ static int realloc_memory(struct cal_block_data *cal_block)
		cal_block->map_data.ion_handle);
	cal_block->map_data.ion_client = NULL;
	cal_block->map_data.ion_handle = NULL;
	cal_block->cal_data.size = 0;

	ret = cal_block_ion_alloc(cal_block);
	if (ret < 0)
+7 −0
Original line number Diff line number Diff line
@@ -1693,6 +1693,13 @@ static int remap_cal_data(struct cal_block_data *cal_block, int cal_index)
{
	int ret = 0;

	if (cal_block->map_data.ion_client == NULL) {
		pr_err("%s: No ION allocation for cal index %d!\n",
			__func__, cal_index);
		ret = -EINVAL;
		goto done;
	}

	if ((cal_block->map_data.map_size > 0) &&
		(cal_block->map_data.q6map_handle == 0)) {
		atomic_set(&this_adm.mem_map_index, cal_index);
+7 −0
Original line number Diff line number Diff line
@@ -1103,6 +1103,13 @@ static int remap_cal_data(struct cal_block_data *cal_block, int cal_index)
{
	int ret = 0;

	if (cal_block->map_data.ion_client == NULL) {
		pr_err("%s: No ION allocation for cal index %d!\n",
			__func__, cal_index);
		ret = -EINVAL;
		goto done;
	}

	if ((cal_block->map_data.map_size > 0) &&
		(cal_block->map_data.q6map_handle == 0)) {
		atomic_set(&this_afe.mem_map_cal_index, cal_index);
+7 −0
Original line number Diff line number Diff line
@@ -511,6 +511,13 @@ static int remap_cal_data(int32_t cal_type, struct cal_block_data *cal_block)
{
	int ret = 0;

	if (cal_block->map_data.ion_client == NULL) {
		pr_err("%s: No ION allocation for cal type %d!\n",
			__func__, cal_type);
		ret = -EINVAL;
		goto done;
	}

	if ((cal_block->map_data.map_size > 0) &&
		(cal_block->map_data.q6map_handle == 0)) {

+7 −0
Original line number Diff line number Diff line
@@ -3619,6 +3619,13 @@ static int remap_cal_data(struct cal_block_data *cal_block,
	int ret = 0;
	pr_debug("%s\n", __func__);

	if (cal_block->map_data.ion_client == NULL) {
		pr_err("%s: No ION allocation for session_id %d!\n",
			__func__, session_id);
		ret = -EINVAL;
		goto done;
	}

	if ((cal_block->map_data.map_size > 0) &&
		(cal_block->map_data.q6map_handle == 0)) {