public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: fix possible null dereference
Date: Sat, 04 Apr 2015 14:34:48 +0200	[thread overview]
Message-ID: <s5hr3s0xeaf.wl-tiwai@suse.de> (raw)
In-Reply-To: <1427973703-2365-1-git-send-email-sudipm.mukherjee@gmail.com>

At Thu,  2 Apr 2015 16:51:43 +0530,
Sudip Mukherjee wrote:
> 
> we are dereferencing pcm first then checking pcm. instead now lets put
> them in same if condition so that pcm is checked first.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Applied, thanks.


Takashi

> ---
>  sound/pci/hda/hda_codec.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 145cae7..7df18e2 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -3717,9 +3717,8 @@ static int add_std_chmaps(struct hda_codec *codec)
>  			struct snd_pcm_chmap *chmap;
>  			const struct snd_pcm_chmap_elem *elem;
>  
> -			if (pcm->own_chmap)
> -				continue;
> -			if (!pcm || !hinfo->substreams)
> +			if (!pcm || pcm->own_chmap ||
> +			    !hinfo->substreams)
>  				continue;
>  			elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;
>  			err = snd_pcm_add_chmap_ctls(pcm->pcm, str, elem,
> -- 
> 1.8.1.2
> 

      reply	other threads:[~2015-04-04 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 11:21 [PATCH] ALSA: hda: fix possible null dereference Sudip Mukherjee
2015-04-04 12:34 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hr3s0xeaf.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sudipm.mukherjee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox