diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-03-05 06:07:15 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-03-05 06:11:54 -0500 |
commit | 4f50b41fa3deb541364462f3014e0b9d09b91f75 (patch) | |
tree | b6522d71afc6e90b2d0f92b3d6b3cdf5d1130c2c /sound/pci | |
parent | 7cf9bb21ee6df76a3a1eaa512a350cb1af00d544 (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')
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 166ec0c120d4..9f10c9e0df5e 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, | |||
1990 | 1990 | ||
1991 | if ((chip->iores = request_mem_region(chip->dsp_registers_phys, sz, | 1991 | if ((chip->iores = request_mem_region(chip->dsp_registers_phys, sz, |
1992 | ECHOCARD_NAME)) == NULL) { | 1992 | ECHOCARD_NAME)) == NULL) { |
1993 | snd_echo_free(chip); | ||
1994 | dev_err(chip->card->dev, "cannot get memory region\n"); | 1993 | dev_err(chip->card->dev, "cannot get memory region\n"); |
1994 | snd_echo_free(chip); | ||
1995 | return -EBUSY; | 1995 | return -EBUSY; |
1996 | } | 1996 | } |
1997 | chip->dsp_registers = (volatile u32 __iomem *) | 1997 | chip->dsp_registers = (volatile u32 __iomem *) |
@@ -1999,8 +1999,8 @@ static int snd_echo_create(struct snd_card *card, | |||
1999 | 1999 | ||
2000 | if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, | 2000 | if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, |
2001 | KBUILD_MODNAME, chip)) { | 2001 | KBUILD_MODNAME, chip)) { |
2002 | snd_echo_free(chip); | ||
2003 | dev_err(chip->card->dev, "cannot grab irq\n"); | 2002 | dev_err(chip->card->dev, "cannot grab irq\n"); |
2003 | snd_echo_free(chip); | ||
2004 | return -EBUSY; | 2004 | return -EBUSY; |
2005 | } | 2005 | } |
2006 | chip->irq = pci->irq; | 2006 | chip->irq = pci->irq; |
@@ -2012,8 +2012,8 @@ static int snd_echo_create(struct snd_card *card, | |||
2012 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), | 2012 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), |
2013 | sizeof(struct comm_page), | 2013 | sizeof(struct comm_page), |
2014 | &chip->commpage_dma_buf) < 0) { | 2014 | &chip->commpage_dma_buf) < 0) { |
2015 | snd_echo_free(chip); | ||
2016 | dev_err(chip->card->dev, "cannot allocate the comm page\n"); | 2015 | dev_err(chip->card->dev, "cannot allocate the comm page\n"); |
2016 | snd_echo_free(chip); | ||
2017 | return -ENOMEM; | 2017 | return -ENOMEM; |
2018 | } | 2018 | } |
2019 | chip->comm_page_phys = chip->commpage_dma_buf.addr; | 2019 | chip->comm_page_phys = chip->commpage_dma_buf.addr; |
@@ -2291,8 +2291,8 @@ static int snd_echo_resume(struct device *dev) | |||
2291 | 2291 | ||
2292 | if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, | 2292 | if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, |
2293 | KBUILD_MODNAME, chip)) { | 2293 | KBUILD_MODNAME, chip)) { |
2294 | snd_echo_free(chip); | ||
2295 | dev_err(chip->card->dev, "cannot grab irq\n"); | 2294 | dev_err(chip->card->dev, "cannot grab irq\n"); |
2295 | snd_echo_free(chip); | ||
2296 | return -EBUSY; | 2296 | return -EBUSY; |
2297 | } | 2297 | } |
2298 | chip->irq = pci->irq; | 2298 | chip->irq = pci->irq; |