Skip to content

Commit 574469e

Browse files
kengitergregkh
authored andcommitted
ALSA: echoaudio: add a check for ioremap_nocache
[ Upstream commit 6ade657 ] In case ioremap_nocache fails, the fix releases chip and returns an error code upstream to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0e9bb07 commit 574469e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sound/pci/echoaudio/echoaudio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,11 @@ static int snd_echo_create(struct snd_card *card,
19531953
}
19541954
chip->dsp_registers = (volatile u32 __iomem *)
19551955
ioremap_nocache(chip->dsp_registers_phys, sz);
1956+
if (!chip->dsp_registers) {
1957+
dev_err(chip->card->dev, "ioremap failed\n");
1958+
snd_echo_free(chip);
1959+
return -ENOMEM;
1960+
}
19561961

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

0 commit comments

Comments
 (0)