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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E217FC433EF for ; Wed, 13 Apr 2022 19:21:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 562F510E38B; Wed, 13 Apr 2022 19:21:56 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id E20C510E38B for ; Wed, 13 Apr 2022 19:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649877714; x=1681413714; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=s08VpzbSBM8sSuxb53M+64h7J0X6db7Ohq3nGdKHjuk=; b=BhjQluV15cB+YEO2FBvZa+tRU4xNVcx+XgvjlnR6uNPHh/bciRzfTpmH oVIoa8hitT6BCvikpv+ORrp30fO/CQ2oR3BWFmyfzQ3D2QgYztTNoJb4F NX8Lj+RO/mKYIaIrp+DJ0CKjd9P2oYXp6bUYmjJ2paKGaavHtj0q5yHxp H20wW5IM5T8yM8/74mZ2cXek7H2dSa7w+CY0+xfpPfOh81avevgAGRDD+ W7sbn+OaZiRxsTrTdSbRtR4UCqDRFDGD+ZO3oQAJOAqS56w+KCAx/0O0y F/Fs8A8MH8BQICSGUhHOHoJbYvZMhB1xK0OqgY9CWxS/1hUq1NXaPI+FP g==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="349189825" X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="349189825" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 12:21:54 -0700 X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="573412744" Received: from adixit-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.129.61]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 12:21:54 -0700 Date: Wed, 13 Apr 2022 12:14:15 -0700 Message-ID: <87o8146bjs.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: intel-gfx@lists.freedesktop.org In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 6/8] drm/i915/gt: Fix memory leaks in per-gt sysfs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andi Shyti , Andrzej Hajda Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 13 Apr 2022 11:11:07 -0700, Ashutosh Dixit wrote: > > All kmalloc'd kobjects need a kobject_put() to free memory. For example in > previous code, kobj_gt_release() never gets called. Even if kobj_gt_release() were to get called, the code allocates 'struct kobj_gt' and frees 'struct kobject'. Similar memory leaks are also present in sysfs_engines.c from where this code pattern is borrowed. Since these memory leaks occur only at module unload (or device removal) they are not serious but it may still be worth it to fix them and also not further propagate an erroneous code pattern. Thanks.