Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 =