diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-11-08 14:36:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-17 13:14:26 -0800 |
commit | aaf238baf31e14cb1c111815193c3a78770b1873 (patch) | |
tree | 36c89b47364c470c7cbafbade2220d5c68a4ccc2 /sound/core/oss | |
parent | 919609d3cba52431b16501a63e6a5d45266a25c6 (diff) | |
download | kernel_samsung_espresso10-aaf238baf31e14cb1c111815193c3a78770b1873.zip kernel_samsung_espresso10-aaf238baf31e14cb1c111815193c3a78770b1873.tar.gz kernel_samsung_espresso10-aaf238baf31e14cb1c111815193c3a78770b1873.tar.bz2 |
ALSA: Fix card refcount unbalance
commit 8bb4d9ce08b0a92ca174e41d92c180328f86173f upstream.
There are uncovered cases whether the card refcount introduced by the
commit a0830dbd isn't properly increased or decreased:
- OSS PCM and mixer success paths
- When lookup function gets NULL
This patch fixes these places.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50251
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core/oss')
-rw-r--r-- | sound/core/oss/mixer_oss.c | 1 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 5cdd0fe..e7c1183 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -75,6 +75,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file) snd_card_unref(card); return -EFAULT; } + snd_card_unref(card); return 0; } diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index ea75724..725a161 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -2454,6 +2454,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) mutex_unlock(&pcm->open_mutex); if (err < 0) goto __error; + snd_card_unref(pcm->card); return err; __error: |