diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-03-12 00:16:40 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-03-12 08:34:36 +0100 |
commit | 2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e (patch) | |
tree | 27162877fe24366ffcb66f8adfa08a780452208e /sound | |
parent | 66efdc71d95887b652a742a5dae51fa834d71465 (diff) | |
download | linux-2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e.tar.gz linux-2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e.tar.bz2 linux-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.c | 3 |
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 = |