From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794084280; b=h8MSg23Sz/N+A8t/TZNMotxFubIqlYD5fFrazXN9mZR6u8AKrexbcFxbAm7g46I65ByT SUIz/BAxhZNv4goXs2mCv1tyAm5tILGuwPEEKs56hkYKe6zEw+G1GMEHMno0xrOI/senl rs42XOdOxktH6zcu3CD12HA2Ze/qRUIluKfa1Jmpp0k0WlcFWII6Fm6C8+RSiPuqyt8HP RMTCx4icHB41+fGJnNEfoZetbSftxKnbCf38kvD95xuZa7shKbv+WvXyoacIoYPNJAVXx 0imnAgnNtZuKBg1ePNnHnxknCG1rpJ2TH6zRYcCPqYkIEd1VqKmEeP0iYkK6ojYdVvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794084280; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=IPm3mqNZ6e+qAhw2GbfDLGuo9LmeBSigrixHpfLPFj0=; b=ykA196tbcbZUHOTg6JvJfhIaZAP4juGJVib/Tix4tGTVa2tRwv1b3i9N8W/4ndgVP+5b /6EGbn5uxggN1rK/i52aYfGcyHb8GKQ5Sk1/52cMd82y5cGasXOqwBa2ffzhCEaD2cJgC tKPYlJEE1MeSYddDJXx5OD03Iweuorb/DXO2ovgQOXlFQ+M7/eUGJ3W2k9qbxnC2h2Ggt Trjo8pUQpN/a6dag9f3yAsh2GlhGmf+Y4r08Z7oqD5ulYPegGzO5Xv4bgoaXgwJefdpOj QrxUiuZ/9fFdaaceDjLDBe4MZMgL5T7LHyTFhcd+NkI6LSoCkL4CI71FzcGD5voKx2A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VNWucWpk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EDF6606A32E; Sat, 7 Nov 2026 20:44:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VNWucWpk Received: by smtp.kernel.org (Postfix) with ESMTPSA id D03E61F0089F; Sat, 7 Nov 2026 20:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794084279; bh=IPm3mqNZ6e+qAhw2GbfDLGuo9LmeBSigrixHpfLPFj0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=VNWucWpkETSDTR5IVj0MisZFv0GDxKS9e9reNOmDtEGwhfwbNubu8DAnlJ6VTCNPK 45oWTq3zRGDOr7iDTAKHk8GV1JXGXIb5rYS357JDhbWO9NBu+ar+0DDr/G9cEK0CSy sRu3bK93XQwk27CasNRLFSumWgE3MLcciQKMuRKbCozlhKxsy7k0PFuIvNij31raz3 /8rTddyg7K4bWXBcfWQUjvcTzPdSUJAMjP76GPbDY0hlfxY1G5vt67uG8yFzWsqvB1 3DpO5ufNY3vtWo198fVq/m7zy/iZmF8O/3Lv1pog/FCl6ht3+sO/orznDSweP9QKRf pKy71kcoVpFSg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 42/58] mtd: rawnand: au1550nd: retain chip state across removal Reply-To: sashiko-reviews@lists.linux.dev To: "James Hilliard" , "Miquel Raynal" , "Richard Weinberger" , "Vignesh Raghavendra" , "Brian Norris" , "Boris Brezillon" , "Arseniy Krasnov" , "Chen-Yu Tsai" , "Jernej Skrabec" , "Samuel Holland" , "Thomas Gleixner" , "Vitaly Wool" , "David Woodhouse" , "Russell King" , "David Woodhouse" , "Mike Rapoport" , "Maxime Coquelin" , "Alexandre Torgue" , "Christophe Kerello" , "Jason Roberts" , "Michal Simek" , "Boris Brezillon" , "Mason Yang" , "Ramuthevar Vadivel Murugan" , "Stefan Agner" , "Lucas Stach" , "Thierry Reding" , "Jonathan Hunter" , "Dmitry Osipenko" , "Matthias Brugger" , "AngeloGioacchino Del Regno" , "Jorge Ramirez-Ortiz" , "Heiko Stuebner" , "Yifeng Zhao" , "Nicolas Ferre" , "Alexandre Belloni" , "Claudiu Beznea" , "Keguang Zhang" , "Jacky Huang" , "Shan-Chun Hung" , "Frank Li" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "Han Xu" , "Liang Yang" , "Neil Armstrong" , "Kevin Hilman" , "Jerome Brunet" , "Martin Blumenstingl" , "Manivannan Sadhasivam" , "Kamal Dasu" , "Broadcom internal kernel review list" , "Vladimir Zapolskiy" , "Piotr Wojtaszczyk" , "Paul Cercueil" , "Harvey Hunt" , "Maxim Levitsky" , "Michael Walle" , "Srinivas Kandagatla" Cc: "Tze Yee Ng" , linux-mtd@lists.infradead.org, linux-sunxi@lists.linux.dev, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, Frank.Li@kernel.org, wsa+renesas@sang-engineering.com In-Reply-To: <20261107-submit-rawnand-retained-handle-lifetime-v1-v1-42-0181ef0cc4c8@gmail.com> References: <20261107-submit-rawnand-retained-handle-lifetime-v1-v1-0-0181ef0cc4c8@gmail.com> <20261107-submit-rawnand-retained-handle-lifetime-v1-v1-42-0181ef0cc4c8@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 07 Nov 2026 20:44:36 +0000 X-Mailing-List: imx@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [High] mtd: rawnand: au1550nd: inverted request_mem_region check in au1550nd_probe() [1] -- commit be3bdca7aa37bf9e70e43be29b0b99a9af4bfa13 Author: James Hilliard mtd: rawnand: au1550nd: retain chip state across removal This commit switches the au1550nd driver to reference-counted NAND controller and chip lifetime management, disconnecting the chip before unmapping MMIO and checking mtd_device_register() errors. > diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au155= 0nd.c > index f1e99197ab845..bd78bcc842822 100644 > --- a/drivers/mtd/nand/raw/au1550nd.c > +++ b/drivers/mtd/nand/raw/au1550nd.c [ ... ] > @@ -333,7 +350,6 @@ static int au1550nd_probe(struct platform_device *pde= v) > out2: > release_mem_region(r->start, resource_size(r)); > out1: > - kfree(ctx); > return ret; > } [Severity: High] This problem wasn't introduced by this patch, but isn't the request_mem_region() check in au1550nd_probe() inverted [1]? drivers/mtd/nand/raw/au1550nd.c:au1550nd_probe() { ... if (request_mem_region(r->start, resource_size(r), "au1550-nand")) { dev_err(&pdev->dev, "cannot claim NAND memory area\n"); ret =3D -ENOMEM; goto out1; } ... } request_mem_region() returns a non-NULL pointer on success, so a successful reservation jumps to out1, fails probe with -ENOMEM, and leaks the claimed memory region. Conversely, a failed reservation proceeds to ioremap() unowned memory. [1] https://sashiko.dev/#/bug/linux-4e401697-4998-4e40-a7e4-60cc21983fb4 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261107-submit-raw= nand-retained-handle-lifetime-v1-v1-0-0181ef0cc4c8@gmail.com?part=3D42