Commit 30e5f003 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix missing va_end() call in snd_hda_codec_pcm_new()

Reported by coverity CID 1296024.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 07b0e5d4
...@@ -873,14 +873,15 @@ struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec, ...@@ -873,14 +873,15 @@ struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec,
struct hda_pcm *pcm; struct hda_pcm *pcm;
va_list args; va_list args;
va_start(args, fmt);
pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
if (!pcm) if (!pcm)
return NULL; return NULL;
pcm->codec = codec; pcm->codec = codec;
kref_init(&pcm->kref); kref_init(&pcm->kref);
va_start(args, fmt);
pcm->name = kvasprintf(GFP_KERNEL, fmt, args); pcm->name = kvasprintf(GFP_KERNEL, fmt, args);
va_end(args);
if (!pcm->name) { if (!pcm->name) {
kfree(pcm); kfree(pcm);
return NULL; return NULL;
......
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