Skip to content

Commit

Permalink
[media] tlg2300: fix missing check for audio creation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Mauro Carvalho Chehab committed Sep 23, 2012
1 parent 4699903 commit da35de6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/usb/tlg2300/pd-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit da35de6

Please sign in to comment.