summaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/echoaudio.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-03-05 14:07:15 +0300
committerTakashi Iwai <tiwai@suse.de>2014-03-05 12:11:54 +0100
commit4f50b41fa3deb541364462f3014e0b9d09b91f75 (patch)
treeb6522d71afc6e90b2d0f92b3d6b3cdf5d1130c2c /sound/pci/echoaudio/echoaudio.c
parent7cf9bb21ee6df76a3a1eaa512a350cb1af00d544 (diff)
ALSA: echoaudio: use after free on error
There are some places where we dereference "chip" in the error message but we've already freed it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/echoaudio/echoaudio.c')
-rw-r--r--sound/pci/echoaudio/echoaudio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 166ec0c120d..9f10c9e0df5 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1990,8 +1990,8 @@ static int snd_echo_create(struct snd_card *card,
if ((chip->iores = request_mem_region(chip->dsp_registers_phys, sz,
ECHOCARD_NAME)) == NULL) {
- snd_echo_free(chip);
dev_err(chip->card->dev, "cannot get memory region\n");
+ snd_echo_free(chip);
return -EBUSY;
}
chip->dsp_registers = (volatile u32 __iomem *)
@@ -1999,8 +1999,8 @@ static int snd_echo_create(struct snd_card *card,
if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) {
- snd_echo_free(chip);
dev_err(chip->card->dev, "cannot grab irq\n");
+ snd_echo_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
@@ -2012,8 +2012,8 @@ static int snd_echo_create(struct snd_card *card,
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
sizeof(struct comm_page),
&chip->commpage_dma_buf) < 0) {
- snd_echo_free(chip);
dev_err(chip->card->dev, "cannot allocate the comm page\n");
+ snd_echo_free(chip);
return -ENOMEM;
}
chip->comm_page_phys = chip->commpage_dma_buf.addr;
@@ -2291,8 +2291,8 @@ static int snd_echo_resume(struct device *dev)
if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) {
- snd_echo_free(chip);
dev_err(chip->card->dev, "cannot grab irq\n");
+ snd_echo_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;