aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-03-12 00:16:40 +0800
committerTakashi Iwai <tiwai@suse.de>2013-03-12 08:34:36 +0100
commit2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e (patch)
tree27162877fe24366ffcb66f8adfa08a780452208e /sound
parentALSA: seq: Fix missing error handling in snd_seq_timer_open() (diff)
downloadlinux-dev-2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e.tar.xz
linux-dev-2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e.zip
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 =