Commit 3b9f7811 authored by Sander van Malssen's avatar Sander van Malssen Committed by Linus Torvalds

[PATCH] fix btaudio error case

Free the right buffer on allocation error
parent d3ed1c8f
...@@ -178,7 +178,7 @@ static int alloc_buffer(struct btaudio *bta) ...@@ -178,7 +178,7 @@ static int alloc_buffer(struct btaudio *bta)
bta->risc_cpu = pci_alloc_consistent bta->risc_cpu = pci_alloc_consistent
(bta->pci, bta->risc_size, &bta->risc_dma); (bta->pci, bta->risc_size, &bta->risc_dma);
if (NULL == bta->risc_cpu) { if (NULL == bta->risc_cpu) {
pci_free_consistent(bta->pci, bta->buf_size, bta->buf_cpu, bta->dma); pci_free_consistent(bta->pci, bta->buf_size, bta->buf_cpu, bta->buf_dma);
bta->buf_cpu = NULL; bta->buf_cpu = NULL;
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment