All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: fix possible null dereference
@ 2015-04-02 11:21 Sudip Mukherjee
  2015-04-04 12:34 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2015-04-02 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel, Sudip Mukherjee

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>
---
 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


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

* Re: [PATCH] ALSA: hda: fix possible null dereference
  2015-04-02 11:21 [PATCH] ALSA: hda: fix possible null dereference Sudip Mukherjee
@ 2015-04-04 12:34 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2015-04-04 12:34 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

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
> 

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

end of thread, other threads:[~2015-04-04 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 11:21 [PATCH] ALSA: hda: fix possible null dereference Sudip Mukherjee
2015-04-04 12:34 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.