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>
This commit is contained in:
Wei Yongjun 2013-03-12 00:16:40 +08:00 committed by Takashi Iwai
parent 66efdc71d9
commit 2e9b9a3c24

View file

@ -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 =