From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 5C13140D for ; Sat, 1 Aug 2015 11:21:13 +0000 (UTC) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 96019175 for ; Sat, 1 Aug 2015 11:21:12 +0000 (UTC) Date: Sat, 1 Aug 2015 13:21:09 +0200 (CEST) From: Julia Lawall To: Laurent Pinchart In-Reply-To: <1624703.qdGzscHWSc@avalon> Message-ID: References: <2111196.TG1k3f53YQ@avalon> <20150731165346.GA18984@infradead.org> <1624703.qdGzscHWSc@avalon> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Christoph Hellwig , Tejun Heo , Russell King , ksummit-discuss@lists.linuxfoundation.org, Shuah Khan Subject: Re: [Ksummit-discuss] [TECH TOPIC] Fix devm_kzalloc, its users, or both List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, 1 Aug 2015, Laurent Pinchart wrote: > On Friday 31 July 2015 09:53:46 Christoph Hellwig wrote: > > On Fri, Jul 31, 2015 at 06:34:21PM +0200, Julia Lawall wrote: > > > How is this different from the free happening explicitly in the remove > > > function? > > > > It's not. The real problem is that people don't understand life time > > rules and expect magic interfaces to fix it for them. > > Exactly. I see two solutions for that, either making people understand life > time rules, or creating interfaces that really fix it for them. devm_kzalloc() > isn't such an interface (and I'm fine if we believe it shouldn't be), but it > unfortunately gives driver developers the impression that it is supposed to > fix the problem. If we conclude that the problem is between the chair and the > keyboard of driver developers then we'll need to start being more vocal about > it. Currently, is there any documentation about when these functions can be used? All I remember seeing is a discussion of what the functions do and what functions are available. But nothing about when they should and should not be used. julia