diff options
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 8753c89f329..48c6a70ad69 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -1642,6 +1642,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) | |||
1642 | write_unlock_irq(&snd_pcm_link_rwlock); | 1642 | write_unlock_irq(&snd_pcm_link_rwlock); |
1643 | up_write(&snd_pcm_link_rwsem); | 1643 | up_write(&snd_pcm_link_rwsem); |
1644 | _nolock: | 1644 | _nolock: |
1645 | snd_card_unref(substream1->pcm->card); | ||
1645 | fput_light(file, fput_needed); | 1646 | fput_light(file, fput_needed); |
1646 | if (res < 0) | 1647 | if (res < 0) |
1647 | kfree(group); | 1648 | kfree(group); |
@@ -2116,7 +2117,9 @@ static int snd_pcm_playback_open(struct inode *inode, struct file *file) | |||
2116 | return err; | 2117 | return err; |
2117 | pcm = snd_lookup_minor_data(iminor(inode), | 2118 | pcm = snd_lookup_minor_data(iminor(inode), |
2118 | SNDRV_DEVICE_TYPE_PCM_PLAYBACK); | 2119 | SNDRV_DEVICE_TYPE_PCM_PLAYBACK); |
2119 | return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK); | 2120 | err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK); |
2121 | snd_card_unref(pcm->card); | ||
2122 | return err; | ||
2120 | } | 2123 | } |
2121 | 2124 | ||
2122 | static int snd_pcm_capture_open(struct inode *inode, struct file *file) | 2125 | static int snd_pcm_capture_open(struct inode *inode, struct file *file) |
@@ -2127,7 +2130,9 @@ static int snd_pcm_capture_open(struct inode *inode, struct file *file) | |||
2127 | return err; | 2130 | return err; |
2128 | pcm = snd_lookup_minor_data(iminor(inode), | 2131 | pcm = snd_lookup_minor_data(iminor(inode), |
2129 | SNDRV_DEVICE_TYPE_PCM_CAPTURE); | 2132 | SNDRV_DEVICE_TYPE_PCM_CAPTURE); |
2130 | return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE); | 2133 | err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE); |
2134 | snd_card_unref(pcm->card); | ||
2135 | return err; | ||
2131 | } | 2136 | } |
2132 | 2137 | ||
2133 | static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) | 2138 | static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) |