From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbbICFsi (ORCPT ); Thu, 3 Sep 2015 01:48:38 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:34215 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbbICFsg (ORCPT ); Thu, 3 Sep 2015 01:48:36 -0400 Subject: Re: [PATCH] null_blk: fix memory leak on cleanup To: Ross Zwisler , axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Matias_Bj=c3=b8rling?= References: <1441023438-16249-1-git-send-email-m@bjorling.me> <20150902183928.GA32255@linux.intel.com> From: Matias Bjorling Message-ID: <55E7DF32.1080805@bjorling.me> Date: Thu, 3 Sep 2015 07:48:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150902183928.GA32255@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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ørling wrote: >> From: Matias Bjørling >> >> Driver was not freeing the memory allocated for internal nullb queues. >> 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.