Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbdFMOB4 (ORCPT ); Tue, 13 Jun 2017 10:01:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57266 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752078AbdFMOBy (ORCPT ); Tue, 13 Jun 2017 10:01:54 -0400 Date: Tue, 13 Jun 2017 16:01:46 +0200 From: Greg KH To: Mike Christie Cc: manish.rangankar@cavium.com, target-devel@vger.kernel.org, nab@linux-iscsi.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, mst@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] uio: Fix uio_device memory leak Message-ID: <20170613140146.GA29175@kroah.com> References: <1496866004-32328-1-git-send-email-mchristi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1496866004-32328-1-git-send-email-mchristi@redhat.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 745 Lines: 19 On Wed, Jun 07, 2017 at 03:06:44PM -0500, Mike Christie wrote: > It looks like there might be 2 issues with the uio_device allocation, or it > looks like we are leaking the device for possibly a specific type of device > case that I could not find but one of you may know about. > > Issues: > 1. We use devm_kzalloc to allocate the uio_device, but the release > function, devm_kmalloc_release, is just a noop, so the memory is never freed. What do you mean by this? If the release function is a noop, lots of memory in the kernel is leaking. UIO shouldn't have to do anything special here, is the devm api somehow broken? If so, let's fix that, not paper over all other driver bugs by moving the UIO code away from it :) thanks, greg k-h