mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 14:21:47 +00:00
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: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
da484d00f0
commit
6ade657d61
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user