From: Russell King - ARM Linux Subject: Re: [PATCH] [FIX] dmaengine: virt-dma: Free descriptor after callback Date: Fri, 18 Apr 2014 09:50:19 +0100 Message-ID: <20140418085019.GN27282@n2100.arm.linux.org.uk> References: <1397782610-7370-1-git-send-email-joelf@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1397782610-7370-1-git-send-email-joelf-l0cyMroinI0@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org To: Joel Fernandes Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org, Vinod Koul , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dan Williams , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-omap@vger.kernel.org On Thu, Apr 17, 2014 at 07:56:50PM -0500, Joel Fernandes wrote: > Free the vd (virt descriptor) after the callback is called. In EDMA driver > atleast which uses virt-dma, we make use of the desc during the callback and if > its dangerously freed before the callback is called. I also noticed this in > omap-dma dmaengine driver. You've missed the vital bit of information: why do you make use of the descriptor afterwards? You shouldn't. omap-dma doesn't either. Once clients submit their request to DMA engine, they must not hold any kind of reference to the descriptor other than the cookie. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it.