fix leak in btaudio
PATCH 1/1 fix leak in btaudio
sound/oss/btaudio.c +4 -1
@@ -177,8 +177,11 @@ static int alloc_buffer(struct btaudio * bta->risc_size =PAGE_SIZE ; bta->risc_cpu =pci_alloc_consistent (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); + bta->buf_cpu =NULL ;return -ENOMEM ; + } }return 0 ; }
Review
Quoted 1 line · On Monday, 29 September 2003 at 18:04:34 +0100, [email protected] wrote:
(quoted diff) +1
-0+ pci_free_consistent(bta->pci, bta->buf_size, bta->buf_cpu, bta->dma);
Surely bta->dma must be bta->buf_dma, like so:
sound/oss/btaudio.c renamed from sound/oss/btaudio.c.~1~ +1 -1
@@ -178,7 +178,7 @@ bta->risc_cpu =pci_alloc_consistent (bta->pci, bta->risc_size, &bta->risc_dma);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 ;return -ENOMEM ; }
Cheers,
Sander
Signature · 2 lines
Sander van Malssen -- [email protected] -- http://www.kozmix.org/ http://www.peteandtommysdayout.com/ -- http://www.1-2-5.net/
Quoted 11 lines · Sander van Malssen
Review
Quoted 1 line · On Monday, 29 September 2003 at 18:04:34 +0100, [email protected] wrote:
(quoted diff) +1
-0+ pci_free_consistent(bta->pci, bta->buf_size, bta->buf_cpu, bta->dma);Surely
bta->dmamust bebta->buf_dma, like so:
sound/oss/btaudio.c line 184
Quoted 8 lines
sound/oss/btaudio.c renamed from sound/oss/btaudio.c.~1~ +1
-1@@ -178,7 +178,7 @@ bta->risc_cpu =pci_alloc_consistent (bta->pci, bta->risc_size, &bta->risc_dma);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 ;return -ENOMEM ; }
Good eyes. Yes, looks correct to me.
Dave
Signature · 1 line
Dave Jones http://www.codemonkey.org.uk