* [PATCH] ALSA: asihpi - fix potential NULL pointer dereference
@ 2013-03-11 16:16 Wei Yongjun
2013-03-12 7:34 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-03-11 16:16 UTC (permalink / raw)
To: perex, tiwai; +Cc: yongjun_wei, alsa-devel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
The dereference should be moved below the NULL test.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
sound/pci/asihpi/asihpi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index 3536b07..0aabfed 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -2549,7 +2549,7 @@ static int snd_asihpi_sampleclock_add(struct snd_card_asihpi *asihpi,
static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
{
- struct snd_card *card = asihpi->card;
+ struct snd_card *card;
unsigned int idx = 0;
unsigned int subindex = 0;
int err;
@@ -2557,6 +2557,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
if (snd_BUG_ON(!asihpi))
return -EINVAL;
+ card = asihpi->card;
strcpy(card->mixername, "Asihpi Mixer");
err =
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: asihpi - fix potential NULL pointer dereference
2013-03-11 16:16 [PATCH] ALSA: asihpi - fix potential NULL pointer dereference Wei Yongjun
@ 2013-03-12 7:34 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2013-03-12 7:34 UTC (permalink / raw)
To: Wei Yongjun; +Cc: perex, yongjun_wei, alsa-devel, linux-kernel
At Tue, 12 Mar 2013 00:16:40 +0800,
Wei Yongjun wrote:
>
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> The dereference should be moved below the NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Applied now. Thanks.
Takashi
> ---
> sound/pci/asihpi/asihpi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
> index 3536b07..0aabfed 100644
> --- a/sound/pci/asihpi/asihpi.c
> +++ b/sound/pci/asihpi/asihpi.c
> @@ -2549,7 +2549,7 @@ static int snd_asihpi_sampleclock_add(struct snd_card_asihpi *asihpi,
>
> static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
> {
> - struct snd_card *card = asihpi->card;
> + struct snd_card *card;
> unsigned int idx = 0;
> unsigned int subindex = 0;
> int err;
> @@ -2557,6 +2557,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
>
> if (snd_BUG_ON(!asihpi))
> return -EINVAL;
> + card = asihpi->card;
> strcpy(card->mixername, "Asihpi Mixer");
>
> err =
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-12 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11 16:16 [PATCH] ALSA: asihpi - fix potential NULL pointer dereference Wei Yongjun
2013-03-12 7:34 ` 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®