[alsa-devel] [RFC 4/5] compress: add the core file
Vinod Koul
vinod.koul at linux.intel.com
Wed Sep 7 20:00:29 CEST 2011
On Wed, 2011-09-07 at 15:12 +0100, Dimitris Papastamos wrote:
> On Wed, Sep 07, 2011 at 02:59:27PM +0100, Dimitris Papastamos wrote:
> > On Fri, Sep 02, 2011 at 11:36:24AM +0530, Vinod Koul wrote:
> > > This patch ads core.c, the file which implements the ioctls and
> > > registers the devices
> > >
> > > Signed-off-by: Vinod Koul <vinod.koul at linux.intel.com>
> > > Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> > > ---
> > > sound/compress_offload/core.c | 632 +++++++++++++++++++++++++++++++++++++++++
> > > 1 files changed, 632 insertions(+), 0 deletions(-)
> > > create mode 100644 sound/compress_offload/core.c
> > >
> > > diff --git a/sound/compress_offload/core.c b/sound/compress_offload/core.c
> > > new file mode 100644
> > > index 0000000..1797dba
> > > --- /dev/null
> >
> > > +static int snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
> > > +{
> > > + struct snd_compr_params *params;
> > > + int retval;
> > > +
> > > + if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
> > > + /*
> > > + * we should allow parameter change only when stream has been
> > > + * opened not in other cases
> > > + */
> > > + params = kmalloc(sizeof(*params), GFP_KERNEL);
> > > + if (!params)
> > > + return -ENOMEM;
> > > + if (copy_from_user(¶ms, (void __user *)arg, sizeof(params)))
> > > + return -EFAULT;
> >
> > This should be copy_from_user(params, ...) and not ¶ms.
>
> Aw and it should be sizeof(*params).
Rightly so, Thanks
--
~Vinod
More information about the Alsa-devel
mailing list