From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932173AbbIBSkU (ORCPT ); Wed, 2 Sep 2015 14:40:20 -0400 Received: from mga02.intel.com ([134.134.136.20]:20172 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932076AbbIBSkT (ORCPT ); Wed, 2 Sep 2015 14:40:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,455,1437462000"; d="scan'208";a="637285233" Date: Wed, 2 Sep 2015 12:39:28 -0600 From: Ross Zwisler To: Matias =?iso-8859-1?Q?Bj=F8rling?= Cc: axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Matias =?iso-8859-1?Q?Bj=F8rling?= Subject: Re: [PATCH] null_blk: fix memory leak on cleanup Message-ID: <20150902183928.GA32255@linux.intel.com> Mail-Followup-To: Ross Zwisler , Matias =?iso-8859-1?Q?Bj=F8rling?= , axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Matias =?iso-8859-1?Q?Bj=F8rling?= References: <1441023438-16249-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1441023438-16249-1-git-send-email-m@bjorling.me> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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