aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-08 09:58:25 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-08 09:58:25 -0500
commit17a4adbe68c8e6c1fde8decb2345dc4acea87934 (patch)
tree16d772ee8b5904ad9b92e1514e131bc504a079ae /sound/core
parentc9adeefda0e29bed628e40e7f9da1f84243937e7 (diff)
parent8bb4d9ce08b0a92ca174e41d92c180328f86173f (diff)
Merge branch 'for-linus' into for-next
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/oss/mixer_oss.c1
-rw-r--r--sound/core/oss/pcm_oss.c1
-rw-r--r--sound/core/pcm_native.c6
-rw-r--r--sound/core/sound.c2
-rw-r--r--sound/core/sound_oss.c2
5 files changed, 8 insertions, 4 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index a9a2e63c0222..e8a1d18774b2 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -76,6 +76,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file)
76 snd_card_unref(card); 76 snd_card_unref(card);
77 return -EFAULT; 77 return -EFAULT;
78 } 78 }
79 snd_card_unref(card);
79 return 0; 80 return 0;
80} 81}
81 82
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index f337b66a020b..4c1cc51772e6 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2454,6 +2454,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
2454 mutex_unlock(&pcm->open_mutex); 2454 mutex_unlock(&pcm->open_mutex);
2455 if (err < 0) 2455 if (err < 0)
2456 goto __error; 2456 goto __error;
2457 snd_card_unref(pcm->card);
2457 return err; 2458 return err;
2458 2459
2459 __error: 2460 __error:
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index b329ca58e63c..c76f6375a96b 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2124,7 +2124,8 @@ static int snd_pcm_playback_open(struct inode *inode, struct file *file)
2124 pcm = snd_lookup_minor_data(iminor(inode), 2124 pcm = snd_lookup_minor_data(iminor(inode),
2125 SNDRV_DEVICE_TYPE_PCM_PLAYBACK); 2125 SNDRV_DEVICE_TYPE_PCM_PLAYBACK);
2126 err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK); 2126 err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK);
2127 snd_card_unref(pcm->card); 2127 if (pcm)
2128 snd_card_unref(pcm->card);
2128 return err; 2129 return err;
2129} 2130}
2130 2131
@@ -2137,7 +2138,8 @@ static int snd_pcm_capture_open(struct inode *inode, struct file *file)
2137 pcm = snd_lookup_minor_data(iminor(inode), 2138 pcm = snd_lookup_minor_data(iminor(inode),
2138 SNDRV_DEVICE_TYPE_PCM_CAPTURE); 2139 SNDRV_DEVICE_TYPE_PCM_CAPTURE);
2139 err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE); 2140 err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE);
2140 snd_card_unref(pcm->card); 2141 if (pcm)
2142 snd_card_unref(pcm->card);
2141 return err; 2143 return err;
2142} 2144}
2143 2145
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 89780c323f19..70ccdab74153 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -114,7 +114,7 @@ void *snd_lookup_minor_data(unsigned int minor, int type)
114 mreg = snd_minors[minor]; 114 mreg = snd_minors[minor];
115 if (mreg && mreg->type == type) { 115 if (mreg && mreg->type == type) {
116 private_data = mreg->private_data; 116 private_data = mreg->private_data;
117 if (mreg->card_ptr) 117 if (private_data && mreg->card_ptr)
118 atomic_inc(&mreg->card_ptr->refcount); 118 atomic_inc(&mreg->card_ptr->refcount);
119 } else 119 } else
120 private_data = NULL; 120 private_data = NULL;
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)
54 mreg = snd_oss_minors[minor]; 54 mreg = snd_oss_minors[minor];
55 if (mreg && mreg->type == type) { 55 if (mreg && mreg->type == type) {
56 private_data = mreg->private_data; 56 private_data = mreg->private_data;
57 if (mreg->card_ptr) 57 if (private_data && mreg->card_ptr)
58 atomic_inc(&mreg->card_ptr->refcount); 58 atomic_inc(&mreg->card_ptr->refcount);
59 } else 59 } else
60 private_data = NULL; 60 private_data = NULL;