ASoC: Intel: Skylake: pointer math issue
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 8 Dec 2015 05:53:22 +0000 (08:53 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 16 Dec 2015 19:23:59 +0000 (19:23 +0000)
"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 <dan.carpenter@oracle.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/skylake/skl-topology.c

index b824450edcb4d1e96ede5cb9cc2c79c08f2e9b01..34f2f7351f66ff924eca8061e2afd436c70512b5 100644 (file)
@@ -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;
        }