From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Zwisler Subject: Re: [PATCH] null_blk: fix memory leak on cleanup Date: Wed, 2 Sep 2015 12:39:28 -0600 Message-ID: <20150902183928.GA32255@linux.intel.com> References: <1441023438-16249-1-git-send-email-m@bjorling.me> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Matias =?iso-8859-1?Q?Bj=F8rling?= To: Matias =?iso-8859-1?Q?Bj=F8rling?= Return-path: Content-Disposition: inline In-Reply-To: <1441023438-16249-1-git-send-email-m@bjorling.me> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Aug 31, 2015 at 02:17:18PM +0200, Matias Bj=F8rling wrote: > From: Matias Bj=F8rling >=20 > Driver was not freeing the memory allocated for internal nullb queues= =2E > This patch frees the memory during driver unload. You may want to consider devm_* style allocations instead. These are f= reed automatically on driver unload, simplifying your error paths and your u= nload logic as well as preventing leaks. See this patch for an example: https://lkml.org/lkml/2015/8/10/992