Merge tag 'kconfig-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-microblaze.git] / sound / core / pcm_compat.c
index 6491afb..946ab08 100644 (file)
@@ -45,10 +45,7 @@ static int snd_pcm_ioctl_rewind_compat(struct snd_pcm_substream *substream,
 
        if (get_user(frames, src))
                return -EFAULT;
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-               err = snd_pcm_playback_rewind(substream, frames);
-       else
-               err = snd_pcm_capture_rewind(substream, frames);
+       err = snd_pcm_rewind(substream, frames);
        if (put_user(err, src))
                return -EFAULT;
        return err < 0 ? err : 0;
@@ -62,10 +59,7 @@ static int snd_pcm_ioctl_forward_compat(struct snd_pcm_substream *substream,
 
        if (get_user(frames, src))
                return -EFAULT;
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-               err = snd_pcm_playback_forward(substream, frames);
-       else
-               err = snd_pcm_capture_forward(substream, frames);
+       err = snd_pcm_forward(substream, frames);
        if (put_user(err, src))
                return -EFAULT;
        return err < 0 ? err : 0;
@@ -432,7 +426,7 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream,
            get_user(frames, &data32->frames))
                return -EFAULT;
        bufptr = compat_ptr(buf);
-       bufs = kmalloc(sizeof(void __user *) * ch, GFP_KERNEL);
+       bufs = kmalloc_array(ch, sizeof(void __user *), GFP_KERNEL);
        if (bufs == NULL)
                return -ENOMEM;
        for (i = 0; i < ch; i++) {