|
@@ -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
|
|
* we should allow parameter change only when stream has been
|
|
* opened not in other cases
|
|
* 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);
|
|
retval = snd_compress_check_input(params);
|
|
if (retval)
|
|
if (retval)
|