Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335517
b: refs/heads/master
c: 8bb4d9c
h: refs/heads/master
i:
  335515: 9b94214
v: v3
  • Loading branch information
Takashi Iwai committed Nov 8, 2012
1 parent 214f373 commit 7f97653
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19a62823eae453619604636082085812c14ee391
refs/heads/master: 8bb4d9ce08b0a92ca174e41d92c180328f86173f
1 change: 1 addition & 0 deletions trunk/sound/core/oss/mixer_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,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;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions trunk/sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,8 @@ static int snd_pcm_playback_open(struct inode *inode, struct file *file)
pcm = snd_lookup_minor_data(iminor(inode),
SNDRV_DEVICE_TYPE_PCM_PLAYBACK);
err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK);
snd_card_unref(pcm->card);
if (pcm)
snd_card_unref(pcm->card);
return err;
}

Expand All @@ -2135,7 +2136,8 @@ static int snd_pcm_capture_open(struct inode *inode, struct file *file)
pcm = snd_lookup_minor_data(iminor(inode),
SNDRV_DEVICE_TYPE_PCM_CAPTURE);
err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE);
snd_card_unref(pcm->card);
if (pcm)
snd_card_unref(pcm->card);
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/core/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/core/sound_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7f97653

Please sign in to comment.