Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp373678lqp; Tue, 11 Jun 2024 07:08:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDrXwX3+vCrTtr4G/SRgWfsLDCXhTumA1Lo2q6wifkWsiMKT6BJCZbQ82pde8ACDgDMnqxmnWe9S1mWrSkZkTDAniztXZudXfNRNap5A== X-Google-Smtp-Source: AGHT+IHE+chvTizu1oQD1Tj0l2ptrNQP1u6xG0DN+/XV9SmwvzESKiS4MsPVE2zHSjyUKBkCyJ1X X-Received: by 2002:a05:6830:1e0b:b0:6f9:82ca:15b5 with SMTP id 46e09a7af769-6f982ca1677mr8396055a34.18.1718114928284; Tue, 11 Jun 2024 07:08:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718114928; cv=pass; d=google.com; s=arc-20160816; b=Vfxgo4bm+tjGGR4lCvpF/PGLj1aF3bCMb3oXq1E2bDW/XPhBhbe2+bg9lPPF/i2ejW fzxMciaOoY0ZdHQbk4fTSysptPZJpuYnHj2uh/1gimq8cR7Oxpjp73/2ScCu9HjhOgLh CpphkHJpog/vU8/eEbX1GAwqyp9Bjg3/Q1bXsNfRSyScHZAFG5CRC+kIpgE8vqvWviKb Z4YRkBhqr9pFjKQzR0otZ0laG8Z8OSmoUgUcZ/WOZCKBsdpnkFhGHG0rpfXcV8BXgB9p +k/y45E0oo00K6XC/10mDoKeieFlM2Ty3C76j8Y8JnBBWu+8hqrPbKrIquQbC2U9mzXj 7wlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=W2pEsKL7o7jrs2TaEo52X5dgZvZI9653hgnLFvrpWSg=; fh=1YKmtlHJcffQu2eUrzr7YYyRcdUHSFWmbq4oAvWjVcY=; b=KryX5REkIjd9AMZEtXgv9MYePmu+s27xzrCVRBD0XO6DraWXJqPnOJW7tW+dDND51U w76pY4gKkYZvZawBsm0nzCXn1kJeIYublQIE+tmhwp2AW0ayBXgKS0S6QmTPRn8ygelo VhbusOZY3z8S3I8w0JCQE/Le+pQ0l4I3IfWpIawGFYOdnnWJ9I3JTxgzfzyxI58uTYTY 3WjJS343Rj4S68+Zqlkhaze4qlKF9G4inNopNgzN95+p4loWpnDBZG1p+spzbIoi0cva YO5mDnYhiDkgJp9oc9g20RbJN8UxJGhYORorwmzwsPqUsKiDliiD5bXz+hOI7YNu3/Fz U6yg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=D0Wm4Gej; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-210030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 46e09a7af769-6f9a3eec8fcsi1691220a34.3.2024.06.11.07.08.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 07:08:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=D0Wm4Gej; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-210030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 25A02284F44 for ; Tue, 11 Jun 2024 14:02:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F98F17D37F; Tue, 11 Jun 2024 14:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="D0Wm4Gej" Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEC241DFF8; Tue, 11 Jun 2024 14:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718114561; cv=none; b=JilrWbqaXMQ4VWrsPvYKHoYMklwefUpQ0qKoZsjwDFw/3pOCumzYua1JdkAK+HFFG+jICoTTYBQ2tvFWvriNFuepOIy0gDoo/Rtwa18fmUKk5l9ejI8NX+F0DQygU4z9itOew4RlcjSG6gCEz1vM1/TjNGd9UCvOelEjhey6g50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718114561; c=relaxed/simple; bh=W2pEsKL7o7jrs2TaEo52X5dgZvZI9653hgnLFvrpWSg=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=d6yH9l4wfWB65vWW1TDVQ4HaK5J1snxhK9U4gz7JVvPNL7K0ZbF6BglD1oZxIBv/8Kyfo6kqozCLZ4KqS/h3d4a3nt56580uYBScztueDw1wOtUXroDaUw2eqhhzTeCKSjFUQ58qSn0+Ewqv0JAB0DeABENZ4aZ5ZhS9hr9lVik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=D0Wm4Gej; arc=none smtp.client-ip=212.227.15.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1718114515; x=1718719315; i=markus.elfring@web.de; bh=W2pEsKL7o7jrs2TaEo52X5dgZvZI9653hgnLFvrpWSg=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:References: Subject:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=D0Wm4Gejk6TSeDRq9+doUX7Io3ROv8ClPa713A7kmm3ChhE6Vrkx5R67ENav3jiB v+HZkq7zNZW/1ui3mJlE7d9A7Jnb3rkNbaI3Ntq1vN88WwUogv6SufuERrGtwdlkO 2aMEyqQlHCMidj4Zpou8EXO0B+Oc5JYfaAmW5X1ugehJErJ0w3T/14bmuObjfHUKR 9lRAXbK2xwFDVqSXrmAuQdFMcj8+I2S1pFOsiiZKDI14AGiB1zZo9BRSARPYQ+ClF MKEB/EM3bJ1ebocSbE1SgcludIdq4+tcgcq9CAVw+BBx0vSMTwubcg/aIGQKdsBmA Se9tCmH10v+UbQ7qpw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.83.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MnG2C-1sihrL0iOa-00dahS; Tue, 11 Jun 2024 16:01:55 +0200 Message-ID: <010b1c91-fbde-4b01-a92e-8c14751c7699@web.de> Date: Tue, 11 Jun 2024 16:01:49 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Javier Carrasco , linux-leds@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Angelo Gioacchino Del Regno , Lee Jones , Matthias Brugger , Pavel Machek Cc: stable@vger.kernel.org, LKML , Jonathan Cameron References: <20240611-leds-mt6360-memleak-v1-1-93642eb5011e@gmail.com> Subject: Re: [PATCH] leds: mt6360: fix memory leak in mt6360_init_isnk_properties() Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240611-leds-mt6360-memleak-v1-1-93642eb5011e@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:vXEYOvaM2JhixxYml/MB3pIPwT5XHFYnYUbXKBTecMbfNFSzCAW sglEHnYhxBF/QKA95KliUnr88huv3OXl/oBThbevXPvjUzrL9ptOZyioC1KoLyERAw31xRH PYYKTd8TQ++HEf7YLdU7+tBTUrXTMRnG6PX70ZHo/+WWQ3PjsKw9ikG+Jm57wme+sNXBb8h 9eluliCCFKTyVWamrGCUw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:lvl8jcAGd20=;KMJvMO4Y+WSHny/FBJphtdHFrTK BTDkJfKQvgkXEAug1o1JXvo58g2oP7YquGiQlBi4/zX1n+/ke6SGlbvAooBsnLF+Q4Q7oaJsC zhU/CeXLiYFdlEzqmzb/PpjaEjixr80Sh7WhFm4Sc6grg+s5Uoj0HlM1RHPKSDSXZLu0SE/Kf PFmItSaAb3esTcyundO+svoGaQDWqgHMHbcFfvvVaFDyIN/Klp3kqtBa1eW7rJLe6o9Vzb4Wm I6dCBxgdtvr4mcbx+glBoGJN+2VALSFoK/QYsMK5S3Ll2z4y6W80fZAcfAOWxQdiEdxC1Dmzf 9lv5xmXcmfvdgoCkpaugjtGsTckjM4T/w0L9c2GuMBNIeCjn7rQAu7a4y5hWyaoAL9NR0GcQn WYYbZ0Nu/dpj1Q2T4wbwHc/28eXeLnd1ZekBiuCh/aS1cU5tFE78RMm1qmFwoc/wyhb9DPxDm 3W/bE2FGYjWEQD2L1nSw0VQ1AfBOcOyp2480d2RJKZCuVrvxjKjQGmEEhEBMewv+YZT3Xl22o CqI80ZrnUA+YWIt6MfdLeugOweV3Oz93UwvR7fuOktr+eG9cMkdHKCJPFlhHSY0fIn/wpVzhB iJoFoRqXIpWNCfpXFZb2N1KJa5A5Yaj3rl/PO8vhW/e5pclPMrQDDxXAmqXsngt+MDGv/5UJ+ aYzgEE4a0i1sBhJoER1ptjqf7trZH0VA86gk+vAUXB5dY8xXdkk8xPAA42BGv4nPgzw07xOFt gs04oBU0ZR4UK9gUGkqryvTQn7BsPuLBjhJr0ifUiB1pBhYfn1XdDkM7u3BALBBnrjNqirh/z hlX1oRumBXo4GAWZWQVYWHrLkRrIYBA3Y0I3wAghzRnkw= =E2=80=A6 > Add the missing calls to fwnode_handle_put(child) to avoid memory leaks > in the error paths. I suggest to apply a goto chain for a while. https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+go= to+chain+when+leaving+a+function+on+error+when+using+and+releasing+resourc= es Will the application of scope-based resource management become feasible wi= th another delay? https://elixir.bootlin.com/linux/v6.10-rc3/source/include/linux/cleanup.h#= L8 Regards, Markus