summaryrefslogtreecommitdiff
path: root/sound/pci/lx6464es/lx6464es.c
diff options
context:
space:
mode:
authorZhouyang Jia <jiazhouyang09@gmail.com>2018-06-14 16:51:46 +0300
committerTakashi Iwai <tiwai@suse.de>2018-06-14 19:01:06 +0300
commit4a23fc8cc068ee5adfb9939d86baaf0f3e180df6 (patch)
treee1cc3bee325e12ff247633bcc276d54ee4c706a1 /sound/pci/lx6464es/lx6464es.c
parent41538f2db1eaa8613ffb3cd0c92a57ace6c0a5f2 (diff)
downloadlinux-4a23fc8cc068ee5adfb9939d86baaf0f3e180df6.tar.xz
ALSA: lx6464es: add error handling for pci_ioremap_bar
When pci_ioremap_bar fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling pci_ioremap_bar. Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lx6464es/lx6464es.c')
-rw-r--r--sound/pci/lx6464es/lx6464es.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index 9655b08a1c52..6c85f13ab23f 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -1016,6 +1016,10 @@ static int snd_lx6464es_create(struct snd_card *card,
/* dsp port */
chip->port_dsp_bar = pci_ioremap_bar(pci, 2);
+ if (!chip->port_dsp_bar) {
+ dev_err(card->dev, "cannot remap PCI memory region\n");
+ goto remap_pci_failed;
+ }
err = request_threaded_irq(pci->irq, lx_interrupt, lx_threaded_irq,
IRQF_SHARED, KBUILD_MODNAME, chip);
@@ -1055,6 +1059,9 @@ device_new_failed:
free_irq(pci->irq, chip);
request_irq_failed:
+ iounmap(chip->port_dsp_bar);
+
+remap_pci_failed:
pci_release_regions(pci);
request_regions_failed: