aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2015-12-08 08:53:22 +0300
committerMark Brown <[email protected]>2015-12-16 19:23:59 +0000
commite8bc3c99fa982f616e74aec4445945400a9c56f3 (patch)
treec6da4b7776110b2e0e5e8e288a59a61edc297e61
parentdb4e561378b539230feb4db5e7d5d548c2db2cd4 (diff)
ASoC: Intel: Skylake: pointer math issue
"data" is a u32 pointer so this copies the information to wrong place entirely. Fixes: 140adfba5280 ('ASoC: Intel: Skylake: Add tlv byte kcontrols') Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Vinod Koul <[email protected]> Tested-by: Dharageswari R <[email protected]> Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/intel/skylake/skl-topology.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index b824450edcb4..34f2f7351f66 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -919,9 +919,9 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
if (bc->params) {
if (copy_to_user(data, &bc->param_id, sizeof(u32)))
return -EFAULT;
- if (copy_to_user(data + sizeof(u32), &size, sizeof(u32)))
+ if (copy_to_user(data + 1, &size, sizeof(u32)))
return -EFAULT;
- if (copy_to_user(data + 2 * sizeof(u32), bc->params, size))
+ if (copy_to_user(data + 2, bc->params, size))
return -EFAULT;
}