Re: [PATCH] viotape: Fix memory and semaphore leak
From: Michael Buesch <hidden>
Date: 2009-08-13 13:18:21
On Thursday 13 August 2009 07:00:03 Benjamin Herrenschmidt wrote:
On Sat, 2009-07-18 at 15:06 +0200, Michael Buesch wrote:quoted
This patch fixes a memory and semaphore leak in the viotape driver's char device write op. It leaks the DMA memory and the semaphore lock in case the device was opened with O_NONBLOCK. This patch is only compile tested, because I do not have the hardware. Signed-off-by: Michael Buesch <redacted>(going trough my backlog ...) Thanks Michael, but I don't think that's right... IE. We aren't waiting for the write to complete, which means that it can be happening asynchronously, thus we must not free the DMA memory until it has actually complete. Now, if you look at vioHandleTapeEvent(), it does appear that when the completion happens, the DMA memory will eventually be released and the mutex up'ed. Or am I missing something ?
I think you are right. -- Greetings, Michael.