diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-27 07:53:06 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-27 07:53:06 -0800 |
commit | ea9f7a67a24a1b3b81cda5d15c79eda8613f1deb (patch) | |
tree | e22ad0c5ae148297a494be7fe1dc30d3b805123a /sound/core | |
parent | 74ea15d909b31158f9b63190a95b52bc05586d4b (diff) | |
parent | b3a81520bd37a28f77cb0f7002086fb14061824d (diff) | |
download | kernel_goldelico_gta04-ea9f7a67a24a1b3b81cda5d15c79eda8613f1deb.zip kernel_goldelico_gta04-ea9f7a67a24a1b3b81cda5d15c79eda8613f1deb.tar.gz kernel_goldelico_gta04-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')
-rw-r--r-- | sound/core/compress_offload.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index dac3633..a68aed7 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; |