Commit 2e9b9a3c authored by Wei Yongjun's avatar Wei Yongjun Committed by Takashi Iwai

ALSA: asihpi - fix potential NULL pointer dereference

The dereference should be moved below the NULL test.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 66efdc71
...@@ -2549,7 +2549,7 @@ static int snd_asihpi_sampleclock_add(struct snd_card_asihpi *asihpi, ...@@ -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) 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 idx = 0;
unsigned int subindex = 0; unsigned int subindex = 0;
int err; int err;
...@@ -2557,6 +2557,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) ...@@ -2557,6 +2557,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
if (snd_BUG_ON(!asihpi)) if (snd_BUG_ON(!asihpi))
return -EINVAL; return -EINVAL;
card = asihpi->card;
strcpy(card->mixername, "Asihpi Mixer"); strcpy(card->mixername, "Asihpi Mixer");
err = err =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment