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>
This commit is contained in:
@@ -114,7 +114,7 @@ void *snd_lookup_minor_data(unsigned int minor, int type)
|
||||
mreg = snd_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;
|
||||
|
Reference in New Issue
Block a user