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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D2DF1CF3183 for ; Tue, 1 Oct 2024 20:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O4r1gnU2kI48G4bH3UKFvm7M16h9YIxfYz+Z1dmrAag=; b=SzEDD4SHQsX0Ng AfZRHo94l8fyTk6+ySfF8cLxLBamHuoyeMymc5bb9G/a1c0gHUguVqt3652WpvE9FuFrugKQ3uERv WQsnxUGcJWhbYShZCejyI7R6obTYQSkA00w2zjyDjAe7l+3xEHn/LNeomtdgoKOYqZi1TsXhWkhhi rloHBAySm9kIXxprfl3JBEg9sL69yrCBTQVYPElTuixkZU3JlK7aaCKnN39y7/H1KkWDe7tM2uRPN ea9jx259WX/p1gTKq0HaxcSLA+e7x6Da9exy2HvO6ORd0xaugwXLw7P31w8inF8iq/BuBioyn1bOy zEAzUtnurz14L+cbOc9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svjhn-000000041aE-1mGd; Tue, 01 Oct 2024 20:42:47 +0000 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svjgY-000000041QD-1Fi1; Tue, 01 Oct 2024 20:41:31 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id A4970240003; Tue, 1 Oct 2024 20:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1727815287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O4r1gnU2kI48G4bH3UKFvm7M16h9YIxfYz+Z1dmrAag=; b=OrJ4kNnTXAhNGXy3lhQzUWOhRp6lCm0BKAPPWoG8vc6fq5sV/c3FhS2ZNGXHRtH0wNx2fJ pZKO43QCAxvpHbWX/hBUJsFY2vDZxLFVWUD8+c2BS5MZ73HzNuAt8n2H0Awr8kaz8Dch40 q4Qrjv13IZyEBlPpplH0hNWlWQlulMgYTfjHHfL71voBO5O74NQifNMF6lElI/gk8CUg1F yB3sqC1yhswITXGyxh41HoX8k9aEHg1XkH74k725aypNBmbsVKCoBLgyhCA7uhRSqzTrxF xpadLLjq46czvMAL8+w7+SH7LV2V0If8FS6sn/Pj+69evtvrFs0C8RSkKgXQHQ== Date: Tue, 1 Oct 2024 22:41:25 +0200 From: Miquel Raynal To: "Dr. David Alan Gilbert" Subject: Re: of atmel_pmecc_destroy_user Message-ID: <20241001224125.032b2a1b@xps-13> In-Reply-To: References: <20240930090817.0a86e538@collabora.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241001_134130_501097_D117A6AC X-CRM114-Status: GOOD ( 23.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard@nod.at, linux-kernel@vger.kernel.org, Boris Brezillon , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, linux@treblig.org wrote on Tue, 1 Oct 2024 20:37:18 +0000: > * Boris Brezillon (boris.brezillon@collabora.com) wrote: > > Hi David, > >=20 > > On Sun, 29 Sep 2024 17:05:01 +0000 > > "Dr. David Alan Gilbert" wrote: > > =20 > > > Hi Boris and co, > > > One of my scripts noticed that 'atmel_pmecc_destroy_user' > > > isn't called anywhere; I was going to delete it, but hmm, I wonder > > > if it's actually a missing call and leaking (in the unlikely case > > > the device was ever removed). > > >=20 > > > It was added by your: > > > commit f88fc122cc34c2545dec9562eaab121494e401ef > > > Author: Boris Brezillon > > > Date: Thu Mar 16 09:02:40 2017 +0100 > > >=20 > > > mtd: nand: Cleanup/rework the atmel_nand driver > > >=20 > > > and I see the allocation in: > > > user =3D kzalloc(size, GFP_KERNEL); > > > in > > > nand->pmecc =3D atmel_pmecc_create_user(nc->pmecc, &req); > > > called in atmel_nand_pmecc_init > > > from atmel_nand_ecc_init > > > from atmel_hsmc_nand_ecc_init > > > =20 > > > But I don't see any freeing. > > >=20 > > > (I don't knowingly have hardware to test a fix, although I guess > > > there's probably one somewhere....) > > >=20 > > > Suggestions? =20 > >=20 > > There's definitely a leak. I haven't looked at NAND stuff for a while > > though, so I'll let Miquel advise you on where > > atmel_pmecc_destroy_user() should be called. =20 >=20 > I see Miquel has posted a fix. >=20 > Thanks to both of you! Looks like you've been too fast :) I was waiting for the lore link to be available, so yes, I looked into it and decided to fix it this way: https://lore.kernel.org/linux-mtd/20241001203149.387655-1-miquel.raynal@boo= tlin.com/T/#u Thanks for the report, Miqu=C3=A8l