summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-03-11 20:16:40 +0400
committerTakashi Iwai <tiwai@suse.de>2013-03-12 11:34:36 +0400
commit2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e (patch)
tree27162877fe24366ffcb66f8adfa08a780452208e /sound
parent66efdc71d95887b652a742a5dae51fa834d71465 (diff)
downloadlinux-2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e.tar.xz
ALSA: asihpi - fix potential NULL pointer dereference
The dereference should be moved below the NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/asihpi/asihpi.c3
1 files changed, 2 insertions, 1 deletions
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 =