From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756115AbbDOK2X (ORCPT ); Wed, 15 Apr 2015 06:28:23 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:34725 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754727AbbDOK2Q (ORCPT ); Wed, 15 Apr 2015 06:28:16 -0400 Date: Wed, 15 Apr 2015 15:58:04 +0530 From: Sudip Mukherjee To: Dan Carpenter Cc: Jonathan Corbet , Jean Delvare , Wolfram Sang , Willy Tarreau , Greg Kroah-Hartman , One Thousand Gnomes , linux-i2c@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH 1/4] parport: modify parport subsystem to use devicemodel Message-ID: <20150415102804.GA3803@sudip-PC> References: <1429084124-2271-1-git-send-email-sudipm.mukherjee@gmail.com> <1429084124-2271-2-git-send-email-sudipm.mukherjee@gmail.com> <20150415082746.GI10964@mwanda> <20150415092055.GA3198@sudip-PC> <20150415094500.GZ16501@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150415094500.GZ16501@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 15, 2015 at 12:45:00PM +0300, Dan Carpenter wrote: > On Wed, Apr 15, 2015 at 02:50:55PM +0530, Sudip Mukherjee wrote: > > > > > > + tmp->name = name; > > > > > > I wonder who frees this name variable. My concern is that it gets > > > freed before we are done using it or something. (I have not looked at > > > the details). > > it will be done in free_port() the release callback of parport device. > > That doesn't work. Some of the callers pass a string literal. oops, when i replied to your first mail about this I looked at parport_register_port(), but the one that you have mentioned is the one I gave in parport_register_dev() and it seems that the name is not freed anywhere except the driver that has called parport_register_device() or parport_register_dev(). I think I should better copy it and then give it to tmp->name and free it also in the unregister function. And this should be fixed in the original parport_register_device() also. I will wait for some more reviews send the v2 series tomorrow. regards sudip > > regards, > dan carpenter >