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

Commit 6ade657d authored by Kangjie Lu's avatar Kangjie Lu Committed by Takashi Iwai
Browse files

ALSA: echoaudio: add a check for ioremap_nocache



In case ioremap_nocache fails, the fix releases chip and returns
an error code upstream to avoid NULL pointer dereference.

Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent da484d00
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1952,6 +1952,11 @@ static int snd_echo_create(struct snd_card *card,
	}
	chip->dsp_registers = (volatile u32 __iomem *)
		ioremap_nocache(chip->dsp_registers_phys, sz);
	if (!chip->dsp_registers) {
		dev_err(chip->card->dev, "ioremap failed\n");
		snd_echo_free(chip);
		return -ENOMEM;
	}

	if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
			KBUILD_MODNAME, chip)) {