sound: echoaudio: add a check for ioremap_nocache
PATCH 1/1 sound: 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 <[email protected]>
--- sound/pci/echoaudio/echoaudio.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/pci/echoaudio/echoaudio.c +5 -0
@@ -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)) {
Signature · 1 line
2.17.1
Takashi Iwai
AppliedQuoted 5 lines · Kangjie Lu
In case
ioremap_nocachefails, the fix releases chip and returns an error code upstream to avoid NULL pointer dereference.Signed-off-by Kangjie Lu <[email protected]>
Applied, thanks.
Takashi