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

Commit 037f4323 authored by Ashish Jain's avatar Ashish Jain Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm: qdsp6v2: DAP: Allocate param buffer with correct size



Size of param buffer should be big enough to hold param length
of data and param payload.

CRs-Fixed: 1033525
Change-Id: I6fa58f87a7c7df5f0485ea5b368ea090eb8bedb4
Signed-off-by: default avatarAshish Jain <ashishj@codeaurora.org>
parent 3f2ae090
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1554,7 +1554,8 @@ static int msm_ds2_dap_get_param(u32 cmd, void *arg)
	pr_debug("%s: port_id 0x%x, copp_idx %d, dev_map[i].device_id %x\n",
		 __func__, port_id, copp_idx, dev_map[i].device_id);

	params_value = kzalloc(params_length, GFP_KERNEL);
	params_value = kzalloc(params_length + param_payload_len,
				GFP_KERNEL);
	if (!params_value) {
		pr_err("%s: params memory alloc failed\n", __func__);
		rc = -ENOMEM;
@@ -1578,9 +1579,9 @@ static int msm_ds2_dap_get_param(u32 cmd, void *arg)
			rc = -EINVAL;
			goto end;
		} else {
			params_length = (ds2_dap_params_length[i] +
						DOLBY_PARAM_PAYLOAD_SIZE) *
						sizeof(uint32_t);
			params_length =
			ds2_dap_params_length[i] * sizeof(uint32_t);

			rc = adm_get_params(port_id, copp_idx,
					    DOLBY_BUNDLE_MODULE_ID,
					    ds2_dap_params_id[i],