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=1796228767; b=SuptqL6LRZbq79Yw0uJSYbiG0jzbBouKsMkv83IA4sU8RPdozZcOk4e2GR3rfbf3h5zC XKxdQMVzAxRYnHkaoTZNerJq0xckQ04JlH2Ah41TSDXzdo2C4TxQdHhX+1xaywVwOCmQ/ 0pCEprvZ9QLzOAndVW24FY/lYtSKEpCq3kkdipepF7n5l5QJKCbz0UuFS9336/oWusVja aJeXxVPa66e7U9H/ChVZVPFiISOzHnW83Zl0IpTSnbBc/AHhcXcKalGrANOv7z1feRy7u hrUzfEMPFWvhwRSESx5fTLjnQsYz2p/bbVQ2WhaKT52/tNRLA5nMJYvg0mmbPasMM6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228767; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=nLca/84HOt3A2d83qGJQs7yCJ9uu08jmk9f3Mn+i58I=; b=4hyMOip3PItihBTdZfw5+Yg2CL5+dzjf5/+F9tEE0A48WGqC73MrhvTsofqSu6wIrioV ih+OXyD06zAa+DJ5PvOTcOy/0jS1cwlUNOyoY903Sej0aT2sCJQYK/DtoUc3Cp6l2GeL7 PqES3ntoPTNRm/EOVTj7TKA+EI+LDh5bRSgtWgZWSSMFzPwAzpS/vjKvyF8VMOzjY+9Bz IKT3Uxu+obdzBEr6sOizax6J+YcyyFghJP4cBofNEYQZQNc1iHzc/9S96hfYWExlhduxv C1inEro2BSHG+qJYOOuKkMBosLenk3xjLfxqynZXtvD1w/1y37LEfQbosmkxhydIUnw== 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=Dz5AsCnd; 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 A3E27606A323; Wed, 2 Dec 2026 16:26:07 +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=Dz5AsCnd Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE4C71F00899; Wed, 2 Dec 2026 16:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796228767; bh=nLca/84HOt3A2d83qGJQs7yCJ9uu08jmk9f3Mn+i58I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Dz5AsCndMQ5qiXA3wLhGSxrLpiVRhVnCWYUp93+PnL6maq97q4tut4nD/3l9KNJUv p4n6Ra/aU8md9XYltEGLPzMjWRlxi3rN+G+JmOgu+u2NUH08mgvUbUg5w/KXaksNA0 nKVXpKLzIFeg8S8yRmMshtmutdpgncWjDaVMQnOfh5MhvFOb0xwoNVBFpJGog+X+GG VXc4lin943ZrnLUS9B/VMiGE5f3EpXzJGL9fF8OAbEj6T8cm73cPpCPANkkjqr0mkH zL5oyNw1/meSSWYdlN9JV92gPDXfjHZNdfRt+SNGq1nTyW22ApH5lamxBeFeBrTqjW J5sJgK+KkMwTw== Date: Wed, 2 Dec 2026 16:26:02 +0000 From: Lee Jones To: Tian Xuechen <202300460064@mail.sdu.edu.cn> Cc: aaro.koskinen@iki.fi, andreas@kemnade.info, khilman@baylibre.com, rogerq@kernel.org, tony@atomide.com, j-keerthy@ti.com, mfd@lists.linux.dev, linux-omap@vger.kernel.org, liguangshuo@mail.sdu.edu.cn Subject: Re: [PATCH 2/2] mfd: tps65218: Fix potential use-after-free by child devices Message-ID: <20261202162602.GK43081@kernel.org> References: <20261126132803.4091137-1-202300460064@mail.sdu.edu.cn> <20261126132803.4091137-3-202300460064@mail.sdu.edu.cn> X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261126132803.4091137-3-202300460064@mail.sdu.edu.cn> On Thu, 26 Nov 2026, Tian Xuechen wrote: > From: Tian Xuechen <202300460064@mail.sdu.edu.cn> > > The MFD children are not removed on unbind, although the parent context > and IRQ chip are device-managed. The children can retain access to > released resources. > > Use managed MFD registration to remove the children before the IRQ chip > and parent context are released. > > This issue was found by our static analysis tool under development. > > Fixes: 44b4dc616365 ("mfd: tps65218: Add driver for the TPS65218 PMIC") This is not correct. It should be: 4531156db726 ("mfd: tps65218: Use mfd_add_devices instead of of_platform_populate") > Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn> > --- > drivers/mfd/tps65218.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c > index 491c379a1a0f..12bef7a11471 100644 > --- a/drivers/mfd/tps65218.c > +++ b/drivers/mfd/tps65218.c > @@ -328,9 +328,9 @@ static int tps65218_probe(struct i2c_client *client) > if (ret) > return ret; > > - ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65218_cells, > - ARRAY_SIZE(tps65218_cells), NULL, 0, > - regmap_irq_get_domain(tps->irq_data)); > + ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65218_cells, > + ARRAY_SIZE(tps65218_cells), NULL, 0, > + regmap_irq_get_domain(tps->irq_data)); > > return ret; Why not return directly whilst you're at it? -- Lee Jones