From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759914AbbKTLwV (ORCPT ); Fri, 20 Nov 2015 06:52:21 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:52696 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbbKTLwU (ORCPT ); Fri, 20 Nov 2015 06:52:20 -0500 Date: Fri, 20 Nov 2015 03:52:12 -0800 From: Christoph Hellwig To: Bart Van Assche Cc: James Bottomley , "Martin K. Petersen" , Christoph Hellwig , Hannes Reinecke , "linux-scsi@vger.kernel.org" , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] Fix a memory leak in scsi_host_dev_release() Message-ID: <20151120115212.GA23875@infradead.org> References: <564D0224.9040001@sandisk.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564D0224.9040001@sandisk.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bart, the memory leak looks real, and your fix looks corret, but I still don't like it. I think it's reasonable for SCSI to assume that the final put_device fully frees the struct device including the name pointer that is assigned entirely behind the back of the caller. So I think the fix for this probably should be in the driver core.