From: Wei Yongjun Date: Mon, 11 Mar 2013 16:16:40 +0000 (+0800) Subject: ALSA: asihpi - fix potential NULL pointer dereference X-Git-Tag: MMI-PSA29.97-13-9~14666^2~29 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ALSA: asihpi - fix potential NULL pointer dereference The dereference should be moved below the NULL test. Signed-off-by: Wei Yongjun Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 3536b076b529..0aabfedeecba 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 =