Commit e8bc3c99 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

ASoC: Intel: Skylake: pointer math issue

"data" is a u32 pointer so this copies the information to wrong place
entirely.

Fixes: 140adfba ('ASoC: Intel: Skylake: Add tlv byte kcontrols')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Tested-by: default avatarDharageswari R <dharageswari.r@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent db4e5613
...@@ -919,9 +919,9 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol, ...@@ -919,9 +919,9 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
if (bc->params) { if (bc->params) {
if (copy_to_user(data, &bc->param_id, sizeof(u32))) if (copy_to_user(data, &bc->param_id, sizeof(u32)))
return -EFAULT; return -EFAULT;
if (copy_to_user(data + sizeof(u32), &size, sizeof(u32))) if (copy_to_user(data + 1, &size, sizeof(u32)))
return -EFAULT; return -EFAULT;
if (copy_to_user(data + 2 * sizeof(u32), bc->params, size)) if (copy_to_user(data + 2, bc->params, size))
return -EFAULT; return -EFAULT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment