summaryrefslogtreecommitdiffstats
path: root/sound/core/compress_offload.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-27 07:53:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-27 07:53:06 -0800
commitea9f7a67a24a1b3b81cda5d15c79eda8613f1deb (patch)
treee22ad0c5ae148297a494be7fe1dc30d3b805123a /sound/core/compress_offload.c
parent74ea15d909b31158f9b63190a95b52bc05586d4b (diff)
parentb3a81520bd37a28f77cb0f7002086fb14061824d (diff)
downloadlinux-ea9f7a67a24a1b3b81cda5d15c79eda8613f1deb.tar.bz2
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Fix silent output on Haier W18 laptop ALSA: hda: set mute led polarity for laptops with buggy BIOS based on SSID ALSA: hda - Fix silent output on ASUS A6Rp ALSA: Fix memory leak on error in snd_compr_set_params() ALSA: ymfpci - Don't create invalid PCM & mixers when AC97 doesn't support
Diffstat (limited to 'sound/core/compress_offload.c')
-rw-r--r--sound/core/compress_offload.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index dac3633507c9..a68aed7fce02 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -441,19 +441,22 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
params = kmalloc(sizeof(*params), GFP_KERNEL);
if (!params)
return -ENOMEM;
- if (copy_from_user(params, (void __user *)arg, sizeof(*params)))
- return -EFAULT;
+ if (copy_from_user(params, (void __user *)arg, sizeof(*params))) {
+ retval = -EFAULT;
+ goto out;
+ }
retval = snd_compr_allocate_buffer(stream, params);
if (retval) {
- kfree(params);
- return -ENOMEM;
+ retval = -ENOMEM;
+ goto out;
}
retval = stream->ops->set_params(stream, params);
if (retval)
goto out;
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
- } else
+ } else {
return -EPERM;
+ }
out:
kfree(params);
return retval;