aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/core/pcm_compat.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index b48b434444ed..9630e9f72b7b 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -255,10 +255,15 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
255 if (! (runtime = substream->runtime)) 255 if (! (runtime = substream->runtime))
256 return -ENOTTY; 256 return -ENOTTY;
257 257
258 /* only fifo_size is different, so just copy all */ 258 data = kmalloc(sizeof(*data), GFP_KERNEL);
259 data = memdup_user(data32, sizeof(*data32)); 259 if (!data)
260 if (IS_ERR(data)) 260 return -ENOMEM;
261 return PTR_ERR(data); 261
262 /* only fifo_size (RO from userspace) is different, so just copy all */
263 if (copy_from_user(data, data32, sizeof(*data32))) {
264 err = -EFAULT;
265 goto error;
266 }
262 267
263 if (refine) 268 if (refine)
264 err = snd_pcm_hw_refine(substream, data); 269 err = snd_pcm_hw_refine(substream, data);