From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DDE0C433DF for ; Wed, 3 Jun 2020 03:01:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BF96207D8 for ; Wed, 3 Jun 2020 03:01:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="ezkeEDVo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725909AbgFCDBj (ORCPT ); Tue, 2 Jun 2020 23:01:39 -0400 Received: from ozlabs.org ([203.11.71.1]:51817 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgFCDBi (ORCPT ); Tue, 2 Jun 2020 23:01:38 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49cDFr0mZBz9sTD; Wed, 3 Jun 2020 13:01:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1591153296; bh=oNX5+B3yN7rD8ZhFo8Gqpc+HpYbEV/fR85vMqUwAnmA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ezkeEDVoIrEXgihjwswT53YYSm9b7aQCc+/JKPjZpEmY1rvyJIiesqBN14sEIS1Nj BOp7gC6V9J6tMJj1elQfy6mN714ToP2lD9LDGXcHbBdtwSRmo6gV00sOILCOrQ4A4k bqUqjTvGWHvx7dwn2iD5CJjeDExgLjOr29A8ItNC1D6hjHwvCtSp/4zauh4PI30Gui vCLInUu5PGr4veb3dqsHKFTMiNW57iveP4Jg4hKKqJXo/qfXy2tBDnfZJvpNh3+zNo ofutgsqEpo3kc0rHtz+QIKbMZ/SNf4j/UCv+lmscprOxnTm1URoX1hasM2WsfeBk/N fSMMHk1LRk9IQ== From: Michael Ellerman To: "wanghai \(M\)" , Markus Elfring , linuxppc-dev@lists.ozlabs.org Cc: Andrew Donnellan , Arnd Bergmann , Frederic Barrat , Greg Kroah-Hartman , Ian Munsie , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr() In-Reply-To: <25ad528b-beaf-820f-9738-ea304dcbc0d7@huawei.com> References: <25ad528b-beaf-820f-9738-ea304dcbc0d7@huawei.com> Date: Wed, 03 Jun 2020 13:02:00 +1000 Message-ID: <877dwoj1hz.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "wanghai (M)" writes: > =E5=9C=A8 2020/6/3 1:20, Markus Elfring =E5=86=99=E9=81=93: >>> Fix it by adding a call to kobject_put() in the error path of >>> kobject_init_and_add(). >> Thanks for another completion of the exception handling. >> >> Would an other patch subject be a bit nicer? > Thanks for the guidance, I will perfect this description and send a v2 >> >> =E2=80=A6 >>> +++ b/drivers/misc/cxl/sysfs.c >>> @@ -624,7 +624,7 @@ static struct afu_config_record *cxl_sysfs_afu_new_= cr(struct cxl_afu *afu, int c >>> rc =3D kobject_init_and_add(&cr->kobj, &afu_config_record_type, >>> &afu->dev.kobj, "cr%i", cr->cr); >>> if (rc) >>> - goto err; >>> + goto err1; >> =E2=80=A6 >> >> Can an other label be more reasonable here? >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/= Documentation/process/coding-style.rst?id=3Df359287765c04711ff54fbd11645271= d8e5ff763#n465 > I just used the original author's label, should I replace all his labels= =20 > like'err','err1' with reasonable one. No. cheers