diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-27 10:53:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-27 10:53:06 -0500 |
commit | ea9f7a67a24a1b3b81cda5d15c79eda8613f1deb (patch) | |
tree | e22ad0c5ae148297a494be7fe1dc30d3b805123a /sound/core | |
parent | 74ea15d909b31158f9b63190a95b52bc05586d4b (diff) | |
parent | b3a81520bd37a28f77cb0f7002086fb14061824d (diff) |
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 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) | |||
441 | params = kmalloc(sizeof(*params), GFP_KERNEL); | 441 | params = kmalloc(sizeof(*params), GFP_KERNEL); |
442 | if (!params) | 442 | if (!params) |
443 | return -ENOMEM; | 443 | return -ENOMEM; |
444 | if (copy_from_user(params, (void __user *)arg, sizeof(*params))) | 444 | if (copy_from_user(params, (void __user *)arg, sizeof(*params))) { |
445 | return -EFAULT; | 445 | retval = -EFAULT; |
446 | goto out; | ||
447 | } | ||
446 | retval = snd_compr_allocate_buffer(stream, params); | 448 | retval = snd_compr_allocate_buffer(stream, params); |
447 | if (retval) { | 449 | if (retval) { |
448 | kfree(params); | 450 | retval = -ENOMEM; |
449 | return -ENOMEM; | 451 | goto out; |
450 | } | 452 | } |
451 | retval = stream->ops->set_params(stream, params); | 453 | retval = stream->ops->set_params(stream, params); |
452 | if (retval) | 454 | if (retval) |
453 | goto out; | 455 | goto out; |
454 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | 456 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; |
455 | } else | 457 | } else { |
456 | return -EPERM; | 458 | return -EPERM; |
459 | } | ||
457 | out: | 460 | out: |
458 | kfree(params); | 461 | kfree(params); |
459 | return retval; | 462 | return retval; |