Skip to contentSkip to conversation

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

PATCH New Takashi Iwai 1 participant 1 message Apr 27, 2015 Sound

lore
Share & tools
lore
#0 lore raw

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

Reported by coverity CID 1296024.

---
 sound/pci/hda/hda_codec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +2 -1
index 27333e0d8ebe..b49feff0a319 100644
@@ -873,14 +873,15 @@ struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec,
 	struct hda_pcm *pcm;
 	va_list args;
 
-	va_start(args, fmt);
 	pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
 	if (!pcm)
 		return NULL;
 
 	pcm->codec = codec;
 	kref_init(&pcm->kref);
+	va_start(args, fmt);
 	pcm->name = kvasprintf(GFP_KERNEL, fmt, args);
+	va_end(args);
 	if (!pcm->name) {
 		kfree(pcm);
 		return NULL;
Signature · 1 line
2.3.5