Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp198107yba; Thu, 2 May 2019 23:29:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy1PXew/U6Fdy653ZpuNBmmcc+jmHWTqywPR3ObXHyynrhpkWaj6h+q0pWRhfZh0A+0fEE X-Received: by 2002:a63:ff26:: with SMTP id k38mr8260881pgi.123.1556864975342; Thu, 02 May 2019 23:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556864975; cv=none; d=google.com; s=arc-20160816; b=UDu2N5yQOrrXP2P/lZybJaHK5kXvpnjjc6WD6pc9mhgtHHv63Ofl/zLJ9uBCQ+ChZQ rzKPAYiMn51L3r6atNTX7OnWHPW3LpBUXT+gCWlCQnGyjX/uBQKJ3BU6DVHWV/0kkRg0 3DvmJXxZXmLXIW87g18CBP84CZquJqDjn8fv1bcJ6/L1oFyrWXfpVbgM+l7gSUNXHCc+ W7lA9dGelI5ggrVmRPkoxO98BUtKG69XlAf9WYQWVnteYIKKEwYfhJggGakosHEbzaDE Vc0sDgGq3TUUGazhu5tHzGhkTTc6az1yBwzjnM9iIKuU/ilEoBN+hbkPuTEFXxkUOe2s XOwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zG7C62LwGPIRyYCAmdVKUD+7ESHqTIY+kp9sS8HyyHo=; b=lKaLAQ0tEaV5dyySRXHCJwTxAv04Tmue2ApE7mbgkUXvX2OagpFrMK8sCNZ2gaA/C6 oQ5J6X+yissG1bNQtj+KcAMznEdaJB0kU+3g4ws7ZkLzG178R9TSCUX3IhVILwS+mr1o 14PIlvA/0zCFytEuz3jpaPcGnLHJNxmLj74f4gipIWk7nKKixjBYsvHUS+9w/d9AeOOZ 893YTbSHKteloLd7d9e6F2zOaxh9is6W/0PHNbR01z66vCJ+UitWAkR63y7O6NDVtPdX mRHKGucUqFZXJPVkXAp7ur33GBvomyt/4XOLtngJFA41PFquyYE3b/ejhS+fp3RDHmtg 7xlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pKa9M0rU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m136si1220253pga.274.2019.05.02.23.29.19; Thu, 02 May 2019 23:29:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pKa9M0rU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726865AbfECG1T (ORCPT + 99 others); Fri, 3 May 2019 02:27:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:35282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfECG1T (ORCPT ); Fri, 3 May 2019 02:27:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70DF8206DF; Fri, 3 May 2019 06:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556864838; bh=ikQLO6/eT8HrwZPXkoqVkYn9ngP4X/Js5fRaLyLbP2U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pKa9M0rUa2nDqQCp72/jGuaDLrrdJtXOwRQ9CtuZTH+Gk2RkwGryJiyrAshl8oqE8 nxE1vmI8F+0YCq7hoeIO3O0JtfPoDD4wBEZPvSjjg3FI798TcgYQKTuqCr0R+X1T1X WSaCNE37x6cVf7VhYGkdyrek53pNjCU5OWLD67uY= Date: Fri, 3 May 2019 08:27:16 +0200 From: Greg Kroah-Hartman To: "Tobin C. Harding" Cc: "Rafael J. Wysocki" , cl@linux.com, tycho@tycho.ws, willy@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kobject: clean up the kobject add documentation a bit more Message-ID: <20190503062716.GA8960@kroah.com> References: <20190427081330.GA26788@eros.localdomain> <20190427192809.GA8454@kroah.com> <20190501215616.GD18827@eros.localdomain> <20190502071742.GC16247@kroah.com> <20190502072808.GA14064@kroah.com> <20190502081918.GA18363@eros.localdomain> <20190502102224.GA15012@kroah.com> <20190503012529.GB7416@eros.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503012529.GB7416@eros.localdomain> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 03, 2019 at 11:25:29AM +1000, Tobin C. Harding wrote: > On Thu, May 02, 2019 at 12:22:24PM +0200, Greg Kroah-Hartman wrote: > > Commit 1fd7c3b438a2 ("kobject: Improve doc clarity kobject_init_and_add()") > > tried to provide more clarity, but the reference to kobject_del() was > > incorrect. Fix that up by removing that line, and hopefully be more explicit > > as to exactly what needs to happen here once you register a kobject with the > > kobject core. > > > > Cc: Tobin C. Harding > > Fixes: 1fd7c3b438a2 ("kobject: Improve doc clarity kobject_init_and_add()") > > Signed-off-by: Greg Kroah-Hartman > > > > diff --git a/lib/kobject.c b/lib/kobject.c > > index 3f4b7e95b0c2..f2ccdbac8ed9 100644 > > --- a/lib/kobject.c > > +++ b/lib/kobject.c > > @@ -416,8 +416,12 @@ static __printf(3, 0) int kobject_add_varg(struct kobject *kobj, > > * to this function be directly freed with a call to kfree(), > > * that can leak memory. > > * > > - * If this call returns successfully and you later need to unwind > > - * kobject_add() for the error path you should call kobject_del(). > > + * If this function returns success, kobject_put() must also be called > > + * in order to properly clean up the memory associated with the object. > > + * > > + * In short, once this function is called, kobject_put() MUST be called > > + * when the use of the object is finished in order to properly free > > + * everything. > > */ > > int kobject_add(struct kobject *kobj, struct kobject *parent, > > const char *fmt, ...) > > Ack! (Do I get to do those :) Yes you do, thanks, now added to the patch and queued up. greg k-h