aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-09-04 09:43:26 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-23 12:50:30 -0400
commitda35de640a0e9c805aba70439f524234890b96c5 (patch)
treecf034fd29fe2272dff4f6b92720dfc8bf7a5c012
parent4699903e4f765af7f9d7b3d63c576290c375c47d (diff)
[media] tlg2300: fix missing check for audio creation
If we fail to set up the capture device we go through negative indexes and badness happens. Add the missing test. Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44551 Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/usb/tlg2300/pd-alsa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/usb/tlg2300/pd-alsa.c b/drivers/media/usb/tlg2300/pd-alsa.c
index 9f8b7da56b67..0c778695e2c3 100644
--- a/drivers/media/usb/tlg2300/pd-alsa.c
+++ b/drivers/media/usb/tlg2300/pd-alsa.c
@@ -305,6 +305,10 @@ int poseidon_audio_init(struct poseidon *p)
305 return ret; 305 return ret;
306 306
307 ret = snd_pcm_new(card, "poseidon audio", 0, 0, 1, &pcm); 307 ret = snd_pcm_new(card, "poseidon audio", 0, 0, 1, &pcm);
308 if (ret < 0) {
309 snd_free_card(card);
310 return ret;
311 }
308 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops); 312 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops);
309 pcm->info_flags = 0; 313 pcm->info_flags = 0;
310 pcm->private_data = p; 314 pcm->private_data = p;