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

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

Merge "msm: ADSPRPC: Fix buffer length for capability API"

parents 3cda3a8d 58eb8759
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -2629,10 +2629,11 @@ static int fastrpc_send_cpuinfo_to_dsp(struct fastrpc_file *fl)
}

static int fastrpc_get_info_from_dsp(struct fastrpc_file *fl,
				uint32_t *dsp_attr, uint32_t dsp_attr_size,
				uint32_t *dsp_attr_buf,
				uint32_t dsp_attr_buf_len,
				uint32_t domain)
{
	int err = 0, dsp_cap_buff_size, dsp_support = 0;
	int err = 0, dsp_support = 0;
	struct fastrpc_ioctl_invoke_crc ioctl;
	remote_arg_t ra[2];
	struct kstat sb;
@@ -2658,7 +2659,7 @@ static int fastrpc_get_info_from_dsp(struct fastrpc_file *fl,
		dsp_support = 0;
		break;
	}
	dsp_attr[0] = dsp_support;
	dsp_attr_buf[0] = dsp_support;

	if (dsp_support == 0)
		goto bail;
@@ -2667,11 +2668,10 @@ static int fastrpc_get_info_from_dsp(struct fastrpc_file *fl,
	if (err)
		goto bail;

	dsp_cap_buff_size = dsp_attr_size - sizeof(uint32_t);
	ra[0].buf.pv = (void *)&dsp_cap_buff_size;
	ra[0].buf.len = sizeof(dsp_cap_buff_size);
	ra[1].buf.pv = (void *)(&dsp_attr[1]);
	ra[1].buf.len = dsp_cap_buff_size * sizeof(uint32_t);
	ra[0].buf.pv = (void *)&dsp_attr_buf_len;
	ra[0].buf.len = sizeof(dsp_attr_buf_len);
	ra[1].buf.pv = (void *)(&dsp_attr_buf[1]);
	ra[1].buf.len = dsp_attr_buf_len * sizeof(uint32_t);
	ioctl.inv.handle = FASTRPC_STATIC_HANDLE_DSP_UTILITIES;
	ioctl.inv.sc = REMOTE_SCALARS_MAKE(0, 1, 1);
	ioctl.inv.pra = ra;
@@ -2703,7 +2703,7 @@ static int fastrpc_get_info_from_kernel(
		 * and cache on kernel
		 */
		err = fastrpc_get_info_from_dsp(fl, dsp_cap->dsp_attributes,
				sizeof(dsp_cap->dsp_attributes),
				FASTRPC_MAX_DSP_ATTRIBUTES - 1,
				domain);
		if (err)
			goto bail;