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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 0646BC433E0 for ; Sat, 20 Jun 2020 13:21:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6A0323B53 for ; Sat, 20 Jun 2020 13:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728176AbgFTNVr (ORCPT ); Sat, 20 Jun 2020 09:21:47 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:25008 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728064AbgFTNVq (ORCPT ); Sat, 20 Jun 2020 09:21:46 -0400 X-IronPort-AV: E=Sophos;i="5.75,258,1589234400"; d="scan'208";a="455762553" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2020 15:21:43 +0200 Date: Sat, 20 Jun 2020 15:21:43 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Bernard Zhao , opensource.kernel@vivo.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, =?ISO-8859-15?Q?Felix_K=FChling?= , =?ISO-8859-15?Q?Christian_K=F6nig?= , Alex Deucher , David Airlie , Daniel Vetter Subject: Re: [PATCH v3] drm/amd: Fix memory leak according to error branch In-Reply-To: <119b7d8c-b164-ef23-84cc-4904d34ac023@web.de> Message-ID: References: <119b7d8c-b164-ef23-84cc-4904d34ac023@web.de> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1522092164-1592659303=:2918" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1522092164-1592659303=:2918 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Sat, 20 Jun 2020, Markus Elfring wrote: > > The function kobject_init_and_add alloc memory like: > > kobject_init_and_add->kobject_add_varg->kobject_set_name_vargs > > ->kvasprintf_const->kstrdup_const->kstrdup->kmalloc_track_caller > > ->kmalloc_slab, in err branch this memory not free. If use > > kmemleak, this path maybe catched. > > These changes are to add kobject_put in kobject_init_and_add > > failed branch, fix potential memleak. > … > > Changes since V2: > > *remove duplicate kobject_put in kfd_procfs_init. > > Under which circumstances are going to improve this change description accordingly? Bernard, please update the log message as well. The mail you sent was much more clear, but mail just gets lost over time. The log message itself should be improved. julia > > Would you like to add the tag “Fixes” to the commit message? > > Regards, > Markus > --8323329-1522092164-1592659303=:2918--