Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019Ab1FMPwu (ORCPT ); Mon, 13 Jun 2011 11:52:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33807 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142Ab1FMPwr (ORCPT ); Mon, 13 Jun 2011 11:52:47 -0400 Date: Mon, 13 Jun 2011 17:52:46 +0200 Message-ID: From: Takashi Iwai To: Greg Thelen Cc: Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hda: check make_exec_verb() return value In-Reply-To: <1307976345-13258-1-git-send-email-gthelen@google.com> References: <1307976345-13258-1-git-send-email-gthelen@google.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1385 Lines: 46 At Mon, 13 Jun 2011 07:45:45 -0700, Greg Thelen wrote: > > If given a -1 cmd parameter then make_exec_verb() returns -1 without > setting the res output value. > > Prior to this change snd_hda_codec_read() assumed that make_exec_verb() > unconditionally set res regardless of the cmd value. > > This change explicitly checks the make_exec_verb() return value before > consuming the potentially unset res value. > > Signed-off-by: Greg Thelen Applied now. Thanks. Takashi > --- > sound/pci/hda/hda_codec.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c > index 45b4a8d..f06dd5f 100644 > --- a/sound/pci/hda/hda_codec.c > +++ b/sound/pci/hda/hda_codec.c > @@ -243,7 +243,8 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid, > { > unsigned cmd = make_codec_cmd(codec, nid, direct, verb, parm); > unsigned int res; > - codec_exec_verb(codec, cmd, &res); > + if (codec_exec_verb(codec, cmd, &res)) > + return -1; > return res; > } > EXPORT_SYMBOL_HDA(snd_hda_codec_read); > -- > 1.7.3.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/