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=1794048556; b=KgcvcycMjHIT1zwQnOpMr1AQ7oDCzKbE8FXaUQPDq29X+uFsGnps9EqehFF9yFJqBfKS Njcgs4Ce+6XPjy6bxzpi3WfssWf29Onu0dOEieBB0gVgkPYaTFmARZ8pyGvGAzUEDqhTJ 6feZXL+miaW7FAXpPOvwXNl9GTcwhFLxTc5txYJUD+MhZe94W7AjAz4870orn6bjXTRio jvzwrJnUCerJTjVdoLof50eim/l3CQX99+YI5Nvp0OtmJbnp0zBL3j5qe+i5pzLu7EWZB 7Ai9VTXxJA+Kd3O/B+IT2ttOgFLAHAgPs22gfuqAaJDUuNbWN5I2YtbM2mMoPcmi4Zw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794048556; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=1XsFWn+SyiA8dPE7n9bDUxOZ7KMzbd2fBhD+Qo9zHI0=; b=roS0zGJLSbFkV1nRN5uaEtVLs/FVRcNvzSlgcEGPKQ+7rRYTUK9XaZxs51b/q7Ybd2y9 0tqFEAcn7jMaaE0WXJziJXANxKcWl5nhkzDnU39IRwe6vsVoVJowONl2eBZ6pXc3ZieeT bfu6YE4zC3BPB2TAOP65YpBtv2ViKK5YHIjJ6FkO4VnrqX13Au3iRGP/lfdLx7iEkjyNW NKmhFc3PXLuSWThDWII87QbEY2bN7uFrvlgQgEdR2OWv58uq7naZC76rgWJvduZS72Ylz EXCBJz7iw327tRNQaMzrah9VOnpZEgMC6U988+IVsx6HgWe8EQkXhb8UVdKbT7gN2/Q== 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=Fq2Rj4O3; 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 D944A6082BE0 for ; Sat, 7 Nov 2026 10:49:15 +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=Fq2Rj4O3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 592C71F01562; Sat, 7 Nov 2026 10:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794048555; bh=1XsFWn+SyiA8dPE7n9bDUxOZ7KMzbd2fBhD+Qo9zHI0=; h=From:To:Cc:Subject:Date; b=Fq2Rj4O3lncu1aXrFfCMQ01ePfm/h5Kc178RYCwEdv99EioDvvTjReH1VvxF+oyKx qNUHTsD/Qss6DP3SdxdLeVJTyvdcGa9Su6toKPrioOp7LiBSQiQCX+VGCOGBzeOMCi 442VZjlV+bcWBgnH/w1cYLKiAbbKUtMvVjq80mA0JV7HncLvo2h9iTcLqSrkYXnSVl 4rq/f0njDlMb32FL2ZUcmLWkwgG3u/cs3Yuirbk3ycbYeVP6cV0QLOQ7lfflRpNNqd pitvuhC6kQ/ocfFWrZrmSn72nTNL8ULCD8/zxszcF9/s2LP/N9KN3W+/v9Uq1Ufeb7 tLEXaurtVKN6Q== From: Sasha Levin To: lgs201920130244@gmail.com, lee@kernel.org Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] mfd: ab8500: Fix child device leaks on probe failure" failed to apply to 6.1-stable tree Date: Sat, 7 Nov 2026 05:49:14 -0500 Message-ID: <20261107054914-failed-6.1-5bf2ae8b131d@kernel.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: stable@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=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x 5bf2ae8b131d4ae9c0ed5f7aa02532645f512022 # git commit -s git send-email --to '' --in-reply-to '20261107054914-failed-6.1-5bf2ae8b131d@kernel.org' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 5bf2ae8b131d4ae9c0ed5f7aa02532645f512022 Mon Sep 17 00:00:00 2001 From: Guangshuo Li Date: Thu, 24 Sep 2026 22:43:55 +0800 Subject: [PATCH] mfd: ab8500: Fix child device leaks on probe failure ab8500_probe() registers MFD child devices before completing the remaining device initialization. If a later MFD registration or sysfs group creation fails, previously registered child devices are not removed. Use devm_mfd_add_devices() so registered MFD child devices are removed when probe fails. The issue was identified by a static analysis tool I developed and confirmed by manual review. Fixes: cca69b67b3ba ("mfd: Export ab8500 chip id to sysfs") Fixes: 9c717cf3fa16 ("mfd: ab8500-core: Add device for new RTC version for AB8540 cut2") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Link: https://patch.msgid.link/20260924144355.1604369-1-lgs201920130244@gmail.com Signed-off-by: Lee Jones --- drivers/mfd/ab8500-core.c | 44 ++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index ceea1ae34dd89..d5602b2f4a0e8 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1194,39 +1194,41 @@ static int ab8500_probe(struct platform_device *pdev) return ret; if (is_ab9540(ab8500)) - ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, - ARRAY_SIZE(ab9540_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, ab9540_devs, + ARRAY_SIZE(ab9540_devs), NULL, + 0, ab8500->domain); else if (is_ab8540(ab8500)) { - ret = mfd_add_devices(ab8500->dev, 0, ab8540_devs, - ARRAY_SIZE(ab8540_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, ab8540_devs, + ARRAY_SIZE(ab8540_devs), NULL, + 0, ab8500->domain); if (ret) return ret; if (is_ab8540_1p2_or_earlier(ab8500)) - ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut1_devs, - ARRAY_SIZE(ab8540_cut1_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, + ab8540_cut1_devs, + ARRAY_SIZE(ab8540_cut1_devs), + NULL, 0, ab8500->domain); else /* ab8540 >= cut2 */ - ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut2_devs, - ARRAY_SIZE(ab8540_cut2_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, + ab8540_cut2_devs, + ARRAY_SIZE(ab8540_cut2_devs), + NULL, 0, ab8500->domain); } else if (is_ab8505(ab8500)) - ret = mfd_add_devices(ab8500->dev, 0, ab8505_devs, - ARRAY_SIZE(ab8505_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, ab8505_devs, + ARRAY_SIZE(ab8505_devs), NULL, + 0, ab8500->domain); else - ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, - ARRAY_SIZE(ab8500_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, ab8500_devs, + ARRAY_SIZE(ab8500_devs), NULL, + 0, ab8500->domain); if (ret) return ret; /* Add battery management devices */ - ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs, - ARRAY_SIZE(ab8500_bm_devs), NULL, - 0, ab8500->domain); + ret = devm_mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs, + ARRAY_SIZE(ab8500_bm_devs), NULL, + 0, ab8500->domain); if (ret) dev_err(ab8500->dev, "error adding bm devices\n"); -- 2.53.0