]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.9/alsa-echoaudio-add-a-check-for-ioremap_nocache.patch
remove unneeded perf patch from 4.9
[thirdparty/kernel/stable-queue.git] / queue-4.9 / alsa-echoaudio-add-a-check-for-ioremap_nocache.patch
1 From 4a9c45a97a419279093a8b28d80f11e6e1012443 Mon Sep 17 00:00:00 2001
2 From: Kangjie Lu <kjlu@umn.edu>
3 Date: Thu, 14 Mar 2019 22:58:29 -0500
4 Subject: ALSA: echoaudio: add a check for ioremap_nocache
5
6 [ Upstream commit 6ade657d6125ec3ec07f95fa51e28138aef6208f ]
7
8 In case ioremap_nocache fails, the fix releases chip and returns
9 an error code upstream to avoid NULL pointer dereference.
10
11 Signed-off-by: Kangjie Lu <kjlu@umn.edu>
12 Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 Signed-off-by: Sasha Levin <sashal@kernel.org>
14 ---
15 sound/pci/echoaudio/echoaudio.c | 5 +++++
16 1 file changed, 5 insertions(+)
17
18 diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
19 index 286f5e3686a3..d73ee11a32bd 100644
20 --- a/sound/pci/echoaudio/echoaudio.c
21 +++ b/sound/pci/echoaudio/echoaudio.c
22 @@ -1953,6 +1953,11 @@ static int snd_echo_create(struct snd_card *card,
23 }
24 chip->dsp_registers = (volatile u32 __iomem *)
25 ioremap_nocache(chip->dsp_registers_phys, sz);
26 + if (!chip->dsp_registers) {
27 + dev_err(chip->card->dev, "ioremap failed\n");
28 + snd_echo_free(chip);
29 + return -ENOMEM;
30 + }
31
32 if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
33 KBUILD_MODNAME, chip)) {
34 --
35 2.19.1
36