linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tlg2300: fix missing check for audio creation
@ 2012-09-04 14:43 Alan Cox
  2012-09-23 19:51 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2012-09-04 14:43 UTC (permalink / raw)
  To: linux-media

From: Alan Cox <alan@linux.intel.com>

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>
---

 drivers/media/usb/tlg2300/pd-alsa.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/usb/tlg2300/pd-alsa.c b/drivers/media/usb/tlg2300/pd-alsa.c
index 9f8b7da..0c77869 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)
 		return ret;
 
 	ret = snd_pcm_new(card, "poseidon audio", 0, 0, 1, &pcm);
+	if (ret < 0) {
+		snd_free_card(card);
+		return ret;
+	}
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops);
 	pcm->info_flags   = 0;
 	pcm->private_data = p;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-23 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-04 14:43 [PATCH] tlg2300: fix missing check for audio creation Alan Cox
2012-09-23 19:51 ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).