Re: [patch] ASoC: Intel: Skylake: pointer math issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 09, 2015 at 09:32:13PM +0530, Vinod Koul wrote:
> On Tue, Dec 08, 2015 at 08:53:22AM +0300, Dan Carpenter wrote:
> > "data" is a u32 pointer so this copies the information to wrong place
> > entirely.
> 
> Thanks this patch makes sense, I will test this tomorrow and get back

Sorry this took a little while longer but this works

Acked-by: Vinod Koul <vinod.koul@xxxxxxxxx>
Tested-by: Dharageswari R <dharageswari.r@xxxxxxxxx>


> > 
> > Fixes: 140adfba5280 ('ASoC: Intel: Skylake: Add tlv byte kcontrols')
> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> > 
> > 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;
> >  	}
> >  
> 
> -- 
> ~Vinod

-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux