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

Commit 24bc5955 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm: qdsp6v2: Fix invalid params handling"

parents 76ccdc74 db7015b1
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -334,6 +334,11 @@ int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
			ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr)
{
	int rc = 0;
	if (!name || !client || !handle || !paddr || !vaddr || !pa_len) {
		pr_err("%s: Invalid params\n", __func__);
		rc = -EINVAL;
		goto err;
	}
	/* client is already created for legacy and given*/
	/* name should be audio_acdb_client or Audio_Dec_Client,
	bufsz should be 0 and fd shouldn't be 0 as of now
@@ -344,7 +349,8 @@ int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
	if (IS_ERR_OR_NULL((void *)(*handle))) {
		pr_err("%s: ion import dma buffer failed\n",
			__func__);
		goto err_ion_handle;
		rc = -EINVAL;
		goto err_destroy_client;
	}

	if (ionflag != NULL) {
@@ -352,6 +358,7 @@ int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
		if (rc) {
			pr_err("%s: could not get flags for the handle\n",
							__func__);
			rc = -EINVAL;
			goto err_ion_handle;
		}
	}
@@ -360,6 +367,7 @@ int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
	if (rc) {
		pr_err("%s: ION Get Physical for AUDIO failed, rc = %d\n",
			__func__, rc);
		rc = -EINVAL;
		goto err_ion_handle;
	}

@@ -367,6 +375,7 @@ int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
	*vaddr = ion_map_kernel(client, *handle);
	if (IS_ERR_OR_NULL((void *)*vaddr)) {
		pr_err("%s: ION memory mapping for AUDIO failed\n", __func__);
		rc = -EINVAL;
		goto err_ion_handle;
	}

@@ -377,8 +386,12 @@ int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,

err_ion_handle:
	ion_free(client, *handle);
	return -EINVAL;

err_destroy_client:
	msm_audio_ion_client_destroy(client);
	client = NULL;
	*handle = NULL;
err:
	return rc;
}

int msm_audio_ion_free_legacy(struct ion_client *client,