From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matias Bjorling Subject: Re: [PATCH] null_blk: fix memory leak on cleanup Date: Thu, 3 Sep 2015 07:48:34 +0200 Message-ID: <55E7DF32.1080805@bjorling.me> References: <1441023438-16249-1-git-send-email-m@bjorling.me> <20150902183928.GA32255@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE To: Ross Zwisler , axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Matias_Bj=c3=b8rling?= Return-path: In-Reply-To: <20150902183928.GA32255@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Den 02-09-2015 kl. 20:39 skrev Ross Zwisler: > On Mon, Aug 31, 2015 at 02:17:18PM +0200, Matias Bj=C3=B8rling wrote: >> From: Matias Bj=C3=B8rling >> >> Driver was not freeing the memory allocated for internal nullb queue= s. >> This patch frees the memory during driver unload. > > You may want to consider devm_* style allocations instead. These are= freed > automatically on driver unload, simplifying your error paths and your= unload > logic as well as preventing leaks. > > See this patch for an example: > > https://lkml.org/lkml/2015/8/10/992 > Thanks for looking through the patches. I'll look into it.