mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda - silence uninitialized variable warning in activate_amp_in()
@ 2017-10-13 10:57 Dan Carpenter
  2017-10-13 13:15 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-10-13 10:57 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Takashi Iwai, Hui Wang, Takashi Sakamoto, alsa-devel,
	linux-kernel, kernel-janitors

If snd_hda_get_conn_list() fails then "conn" isn't initialized.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 28e265a88383..5cc65093d941 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -795,6 +795,8 @@ static void activate_amp_in(struct hda_codec *codec, struct nid_path *path,
 	hda_nid_t nid = path->path[i];
 
 	nums = snd_hda_get_conn_list(codec, nid, &conn);
+	if (nums < 0)
+		return;
 	type = get_wcaps_type(get_wcaps(codec, nid));
 	if (type == AC_WID_PIN ||
 	    (type == AC_WID_AUD_IN && codec->single_adc_amp)) {

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

* Re: [PATCH] ALSA: hda - silence uninitialized variable warning in activate_amp_in()
  2017-10-13 10:57 [PATCH] ALSA: hda - silence uninitialized variable warning in activate_amp_in() Dan Carpenter
@ 2017-10-13 13:15 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-10-13 13:15 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jaroslav Kysela, alsa-devel, Hui Wang, Takashi Sakamoto,
	kernel-janitors, linux-kernel

On Fri, 13 Oct 2017 12:57:10 +0200,
Dan Carpenter wrote:
> 
> If snd_hda_get_conn_list() fails then "conn" isn't initialized.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


Takashi

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

end of thread, other threads:[~2017-10-13 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 10:57 [PATCH] ALSA: hda - silence uninitialized variable warning in activate_amp_in() Dan Carpenter
2017-10-13 13:15 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®