From: Takashi Iwai <tiwai@suse.de>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: perex@perex.cz, yongjun_wei@trendmicro.com.cn,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: asihpi - fix potential NULL pointer dereference
Date: Tue, 12 Mar 2013 08:34:55 +0100 [thread overview]
Message-ID: <s5hsj41kr4w.wl%tiwai@suse.de> (raw)
In-Reply-To: <CAPgLHd8oUa=YMtQ1P5Qo4=M0ysqJV4L7U9RCN0W7aB+A4xLbvA@mail.gmail.com>
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 =
>
>
prev parent reply other threads:[~2013-03-12 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 16:16 Wei Yongjun
2013-03-12 7: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=s5hsj41kr4w.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=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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
all inboxes | Powered by JetHome®