From nobody Tue Dec 16 07:33:17 2025 Received: from cstnet.cn (smtp81.cstnet.cn [159.226.251.81]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05FA128136C for ; Sun, 14 Dec 2025 14:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765724349; cv=none; b=Xumc9vuqpi350c+jTAvZYSxV/RYM8/HUZ1preo7fkIVclxfySpjlQ7hm7BSa0XgqtiSjT2Zfs1zSUOAKadhwtLc0JCXjlIE75nXubD2jGUsfs5sjg+FMFu7Zv9v/64vLW9fv6mc5nM44ri0pztvgi3Rys6N3gIxc1wgtPzlqL8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765724349; c=relaxed/simple; bh=FFE3acX8uHQJo4SvUa61OZl1yUUPasdsvL3ISvwi44Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FaNqal1gOac9uoJpqqhrC8NZeGsjnO7wQv1V9UxmaycXo1zICHs94odkHm3yFoscx/xHEvqqOsZRJL7MoxaZkD+wPVnvZDcgReWL1Z0c225nb6Qobvv1H8zgOYzKqFaXQIlBeW6czfJjkYAcmPelv78F9f44OcTV8YN5iDa6vQA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from DESKTOP-L0HPE2S (unknown [114.245.38.183]) by APP-03 (Coremail) with SMTP id rQCowAB3lNu10D5ppDa1AA--.8507S2; Sun, 14 Dec 2025 22:59:02 +0800 (CST) From: Haotian Zhang To: lee@kernel.org Cc: ckeepax@opensource.wolfsonmicro.com, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Haotian Zhang Subject: [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure Date: Sun, 14 Dec 2025 22:58:03 +0800 Message-ID: <20251214145804.2037-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.50.1.windows.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: rQCowAB3lNu10D5ppDa1AA--.8507S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Wr18Jr4rJFy7uFW5urWDCFg_yoWfZrb_Aa 1kXry3Cr4Fkw1Ivr45ZFyY934Syr4DWFZ3ZF4xta9xJFyjga13Xr1DZry5Ar129a95ZF98 WrsxZ3yfAw1a9jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbckFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s 1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0 cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8Jw ACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc7CjxVAaw2AFwI0_JF0_ Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxV WUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI 7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r 1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI 42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x0JUSNtxUUUUU= X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCRAQA2k+UJHWfwABs0 Content-Type: text/plain; charset="utf-8" The wm5102_clear_write_sequencer() helper may return an error and just return, bypassing the cleanup sequence and causing regulators to remain enabled, leading to a resource leak. Change the direct return to jump to the err_reset label to properly free the resources. Fixes: 1c1c6bba57f5 ("mfd: wm5102: Ensure we always boot the device fully") Signed-off-by: Haotian Zhang Reviewed-by: Charles Keepax --- drivers/mfd/arizona-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 85ff8717d850..91975536d14d 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -1100,7 +1100,7 @@ int arizona_dev_init(struct arizona *arizona) } else if (val & 0x01) { ret =3D wm5102_clear_write_sequencer(arizona); if (ret) - return ret; + goto err_reset; } break; default: --=20 2.50.1.windows.1