public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix leak in btaudio
@ 2003-09-29 17:04 davej
  2003-10-01 18:31 ` Sander van Malssen
  0 siblings, 1 reply; 3+ messages in thread
From: davej @ 2003-09-29 17:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/sound/oss/btaudio.c linux-2.5/sound/oss/btaudio.c
--- bk-linus/sound/oss/btaudio.c	2003-09-08 00:49:05.000000000 +0100
+++ linux-2.5/sound/oss/btaudio.c	2003-09-08 01:32:13.000000000 +0100
@@ -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;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-01 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-29 17:04 [PATCH] fix leak in btaudio davej
2003-10-01 18:31 ` Sander van Malssen
2003-10-01 18:35   ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox