Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp11217yba; Thu, 2 May 2019 18:29:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIyil5WIEK/yZa6btWv3M6Zu6+yWlpOwp5EeuY+WPImHOxZTzUODm+WA+9VIrbNlzPJAKj X-Received: by 2002:a65:47c6:: with SMTP id f6mr7250746pgs.173.1556846966675; Thu, 02 May 2019 18:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556846966; cv=none; d=google.com; s=arc-20160816; b=RXmKF4sGFfSDPduDfn4QB+gBXW0hh1MwY8aEvjo71050wcUKqMbwMFc9zL+mRE/Mp5 PjI6r0vnfhS4DLgZ6nN+Q2xRL/8pYh9jzJlTtrqCLTnEJgWdM0diGfy5OEM3ljCioJBy zOk1oIrtPeITiI6TspjCp4cp0U5jCc9oXRNHE6zLiYCknDoCeTrTm/cus8bZLRMQkRQc oo3LcvUuHxrrGwQY+PMBIju7x2r5f55qM8RlUF1GvJlv7WZ0oLEzUgrLKAqvuacWiFTi oEma/EF284yu4hyp+SbjoFRFEACV16bc6f9Uu0KDS45ZNulsEtstIwL8RAB0bECrTOnz DIUg== 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:dkim-signature; bh=D2oLVdQYiql0cUyr/54+TM5XSJv4u98j3rVtHpPPqXs=; b=a92AtE+YlEE9ERd7e3WwLvBiaGKzEknutn2pJ7VVTsXMKjhDmdNQ0+og1yKpLDAxmy PDqugNNk4TOmXTdGF32DgOsneEoPmjgy6zpTt73SwkGpwC5EVn+TE36hKOJ8+cQL5MzS C3mYMltkyEIMD7R+w/lP3OtS2w0yeB8paoFJWELAErSYrRPh8Lw8yNkbrqEcFFxHBg50 tcYPEQeEUXgS08yZaN23ZuNlcswSxKUfOSFs50pGm7vPqvkfBujYafoXc2iYtYZYswCI u5EStJpOjt9V+YmCUHs5ZrtiyieK11tyG2eB9zWu32P3RTtO5nQ+OGhD7kVBjofXL751 S1TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=e3nVxBov; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=KnDdNtxq; 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 y19si758174plr.236.2019.05.02.18.29.11; Thu, 02 May 2019 18:29:26 -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=@tobin.cc header.s=fm3 header.b=e3nVxBov; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=KnDdNtxq; 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 S1726596AbfECB0M (ORCPT + 99 others); Thu, 2 May 2019 21:26:12 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40971 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbfECB0M (ORCPT ); Thu, 2 May 2019 21:26:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D91A121E92; Thu, 2 May 2019 21:26:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 02 May 2019 21:26:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobin.cc; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=D2oLVdQYiql0cUyr/54+TM5XSJv 4u98j3rVtHpPPqXs=; b=e3nVxBovcJhMTPbEmnf9VUK8pydq4McsVaOjVV+shbm 6uRVU5cQBQHlSBvJpmccfgFREkmIPZjZZP2GidVQBcwsYNrDzZkLdsX2UKlAwCEo bpK/Zoqy6UzZHPJxIDGGQA1VA5AejmzHXHzGw59mD/8HueYyN6D8Q8IyMWi7Bnfs EZLrVZCut12+RzE8CTQ+0gKTdRDb09T3JecE5UZ6lzTXqJ0uLKZzjncWEQrYBkB+ ZFyFThMAjvvDvA7fx41HP08NWyr5atPHYNjjPiwEDASNLAvpy0DbPuttiQyKnlE3 tkIXzBooZOIyyEyJp4450MiBXHKOiaHTA5oshRH1dag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=D2oLVd QYiql0cUyr/54+TM5XSJv4u98j3rVtHpPPqXs=; b=KnDdNtxqGRpTEw0hmPecEr eKvhJNu1ck4EPpyV/VkGrPcd+rb+/lf3RbSh6d8kqaBmq9F9+IIr+4XRfV6jCN5G jzZlvhUyfqhe83is+g/fbEADbxLtjonAjf6D+rOk1kHLACERfjMCLsbQSGJBg0IO qlmDqOajGFmONbK1SrItl+Zi3jBf6TrrpXo0d8BxLheEOCvnHP0pArRSoK2RXJOX /xWWhqmp3j3matstpktdWv4TIcQjC/z474FmUti+6VkdeKtlqu7N3hxphEBwmlwv isUbEPq02d54sCJt7eVTyL2l1/P57vPQ9t6reHK90Mx49eCbyBP+0/WzZ75RGXng == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjedtgdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdduhedmnecujfgurhepfffhvffukfhfgggtuggjofgfsehttdertdfo redvnecuhfhrohhmpedfvfhosghinhcuvedrucfjrghrughinhhgfdcuoehmvgesthhosg hinhdrtggtqeenucfkphepuddvuddrgeegrddvtdegrddvfeehnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehmvgesthhosghinhdrtggtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (ppp121-44-204-235.bras1.syd2.internode.on.net [121.44.204.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 7224510369; Thu, 2 May 2019 21:26:09 -0400 (EDT) Date: Fri, 3 May 2019 11:25:29 +1000 From: "Tobin C. Harding" To: Greg Kroah-Hartman 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: <20190503012529.GB7416@eros.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190502102224.GA15012@kroah.com> X-Mailer: Mutt 1.11.4 (2019-03-13) 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 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 :) I'm not convinced we have the docs for kobject clear enough for a kobject noob to read but this patch defiantly fixes the error I introduced. thanks, Tobin.