summaryrefslogtreecommitdiff
path: root/sound/core/sound_oss.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-08 14:36:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-17 13:16:36 -0800
commit32896690903c576809f21724115612a82a102a52 (patch)
tree096dbdeeb7c8711727f74fa431abd8124c02d100 /sound/core/sound_oss.c
parent13ec0431e7523a5a2d45dd6513b12b5f6b4ddec9 (diff)
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/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 7442c7ac2469..ec86009141d0 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;