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

This commit is contained in:
qctecmdr 2019-10-24 11:15:20 -07:00 • committed by Gerrit - the friendly Code Review server
commit a82524f12a

View file

@ -2375,10 +2375,11 @@ static int fastrpc_kstat(const char *filename, struct kstat *stat)
}
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;
@ -2404,7 +2405,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;
@ -2413,11 +2414,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;
@ -2449,7 +2449,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;