aboutsummaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2021-01-31 18:09:14 +0800
committerTakashi Iwai <tiwai@suse.de>2021-02-01 09:17:01 +0100
commit0074946932cbd42647da947408a9d620746a4e0e (patch)
tree29f227af6c94b3743acf79982b15dea312770544 /sound/pci
parent0417fadab493b55093ba2590f4e66c828f7084fe (diff)
downloadlinux-0074946932cbd42647da947408a9d620746a4e0e.tar.gz
ALSA: intel8x0: Fix missing check in snd_intel8x0m_create
When device_type == DEVICE_ALI, we should also check the return value of pci_iomap() to avoid potential null pointer dereference. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20210131100916.7915-1-dinghao.liu@zju.edu.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/intel8x0m.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 1b7df0c4e57c..19872cecc9d2 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -1129,13 +1129,14 @@ static int snd_intel8x0m_create(struct snd_card *card,
chip->bmaddr = pci_iomap(pci, 3, 0);
else
chip->bmaddr = pci_iomap(pci, 1, 0);
+
+port_inited:
if (!chip->bmaddr) {
dev_err(card->dev, "Controller space ioremap problem\n");
snd_intel8x0m_free(chip);
return -EIO;
}
- port_inited:
/* initialize offsets */
chip->bdbars_count = 2;
tbl = intel_regs;