From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:50730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731539AbeK3B0g (ORCPT ); Thu, 29 Nov 2018 20:26:36 -0500 Date: Thu, 29 Nov 2018 19:50:55 +0530 From: Vinod Koul To: Richard Genoud Cc: Ludovic Desroches , Dan Williams , Alexandre Belloni , Nicolas Ferre , Maxime Ripard , Mario Forner , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] dmaengine: at_hdmac: fix memory leak in at_dma_xlate() Message-ID: <20181129142054.GH3175@vkoul-mobl.Dlink> References: <20181127160635.11836-1-richard.genoud@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181127160635.11836-1-richard.genoud@gmail.com> Sender: stable-owner@vger.kernel.org List-ID: On 27-11-18, 17:06, Richard Genoud wrote: > The leak was found when opening/closing a serial port a great number of > time, increasing kmalloc-32 in slabinfo. > > Each time the port was opened, dma_request_slave_channel() was called. > Then, in at_dma_xlate(), atslave was allocated with devm_kzalloc() and > never freed. (Well, it was free at module unload, but that's not what we > want). > So, here, kzalloc is more suited for the job since it has to be freed in > atc_free_chan_resources(). Applied, thanks -- ~Vinod