Commit da35de64 authored by Alan Cox's avatar Alan Cox Committed by Mauro Carvalho Chehab

[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=44551Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4699903e
...@@ -305,6 +305,10 @@ int poseidon_audio_init(struct poseidon *p) ...@@ -305,6 +305,10 @@ int poseidon_audio_init(struct poseidon *p)
return ret; return ret;
ret = snd_pcm_new(card, "poseidon audio", 0, 0, 1, &pcm); 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); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops);
pcm->info_flags = 0; pcm->info_flags = 0;
pcm->private_data = p; pcm->private_data = p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment