From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [patch] ASoC: Intel: Skylake: pointer math issue Date: Tue, 8 Dec 2015 08:53:22 +0300 Message-ID: <20151208055321.GA5597@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline Sender: kernel-janitors-owner@vger.kernel.org To: Liam Girdwood Cc: Mark Brown , Jaroslav Kysela , Takashi Iwai , Vinod Koul , Jeeja KP , "Subhransu S. Prusty" , Hardik T Shah , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org List-Id: alsa-devel@alsa-project.org "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 diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index dde8d3c..2c4405e 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -885,9 +885,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; }