summaryrefslogtreecommitdiff
path: root/sound/core/sound_oss.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-08 17:36:18 +0400
committerTakashi Iwai <tiwai@suse.de>2012-11-08 17:36:18 +0400
commit8bb4d9ce08b0a92ca174e41d92c180328f86173f (patch)
treeed2d1ed4e401736de2cc67f8660d43b156d3a0b4 /sound/core/sound_oss.c
parent19a62823eae453619604636082085812c14ee391 (diff)
downloadlinux-8bb4d9ce08b0a92ca174e41d92c180328f86173f.tar.xz
ALSA: Fix card refcount unbalance
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 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/sound_oss.c')
-rw-r--r--sound/core/sound_oss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c
index e1d79ee35906..726a49ac9725 100644
--- a/sound/core/sound_oss.c
+++ b/sound/core/sound_oss.c
@@ -54,7 +54,7 @@ void *snd_lookup_oss_minor_data(unsigned int minor, int type)
mreg = snd_oss_minors[minor];
if (mreg && mreg->type == type) {
private_data = mreg->private_data;
- if (mreg->card_ptr)
+ if (private_data && mreg->card_ptr)
atomic_inc(&mreg->card_ptr->refcount);
} else
private_data = NULL;