[PATCH] viotape: Fix memory and semaphore leak

Michael Buesch mb at bu3sch.de
Thu Aug 13 23:18:07 EST 2009

On Thursday 13 August 2009 07:00:03 Benjamin Herrenschmidt wrote:
> On Sat, 2009-07-18 at 15:06 +0200, Michael Buesch wrote:
> > 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 <mb at bu3sch.de>
> (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.

More information about the Linuxppc-dev mailing list