diff options
Diffstat (limited to 'sound/core/compress_offload.c')
-rw-r--r-- | sound/core/compress_offload.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 2c498488af6c..fec1dfdb14ad 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -553,13 +553,9 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) * 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(params, (void __user *)arg, sizeof(*params))) { - retval = -EFAULT; - goto out; - } + params = memdup_user((void __user *)arg, sizeof(*params)); + if (IS_ERR(params)) + return PTR_ERR(params); retval = snd_compress_check_input(params); if (retval) @@ -784,7 +780,7 @@ static int snd_compress_wait_for_drain(struct snd_compr_stream *stream) ret = wait_event_interruptible(stream->runtime->sleep, (stream->runtime->state != SNDRV_PCM_STATE_DRAINING)); if (ret == -ERESTARTSYS) - pr_debug("wait aborted by a signal"); + pr_debug("wait aborted by a signal\n"); else if (ret) pr_debug("wait for drain failed with %d\n", ret); @@ -966,7 +962,7 @@ static int snd_compress_dev_register(struct snd_device *device) compr->card, compr->device, &snd_compr_file_ops, compr, &compr->dev); if (ret < 0) { - pr_err("snd_register_device failed\n %d", ret); + pr_err("snd_register_device failed %d\n", ret); return ret; } return ret; |