From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CB9F3FE67E; Mon, 11 May 2026 14:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778510245; cv=none; b=NaEyckNlXc9+mkt38AOv03QoyuNW0CGAJicFj+vB57gvmyF/wA+EnLgc/af1mmEAh9CCDebe+1moVu2Tdo1HeEpl0s1m+CV3zUlybT2he3fsmCK8mYjUU8SYGhSyj0zZ6piD6xzJTSr3gC+jFHi75NBgx4L/uZb5NITsiw0m06U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778510245; c=relaxed/simple; bh=Syz9agCjo0v7ek7ZUl8IDRv5CIYKzs5t99pAAWh8o7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a11lgylY7ozmqth5iUcD0+wboY16FZoc0G+0PVaGFzAihbiGNI4TTD0Qj8BSyEOZfSyXo08Qxv6AN5vYeLpKGKuTzj/kML2gT+xcXLOqjuY/E4ok5Zk6fR/21SfA25mdIa7fJTd8MwVal/+H/RHaTSTY4MwQ/Wj9eUT0/AwS8lA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iJgBLbhC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iJgBLbhC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BD34C4AF0B; Mon, 11 May 2026 14:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778510244; bh=Syz9agCjo0v7ek7ZUl8IDRv5CIYKzs5t99pAAWh8o7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJgBLbhCrwBKgY2hvKQvF238S4Zu3IsuatUk/oA1J//26H3DodD048y4pTQtCqry7 p3reXAdUmgSTcBIzCylZaez5P6PL0KXDHTRxZP8+keH1K1xYws0vqIupd4Ds9NRu8L 3jsAO3Wvik3ouQbrc66iVMDthdFiNUDFrFXgr05K0DIrS2spu/JhVKWx0+Z7JENA7h 1AjGNyQbKtIe9UYqjn9rMCA9mVK2tDT8nsZZ/MND7Xxbl5b9CXDgFExzwGMxOc25x/ gRABapJILGgm7JGvWOqy+J1eaeeNKElw+HJYz9utGQJEPqD85aenaXtkxGw9roKmxH P5gkpUnZ5ItHQ== Received: from johan by xi.lan with local (Exim 4.98.2) (envelope-from ) id 1wMRl4-000000033q7-0cpH; Mon, 11 May 2026 16:37:22 +0200 From: Johan Hovold To: Wolfram Sang Cc: Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org, Benjamin Tissoires Subject: [PATCH v3 01/10] i2c: core: fix irq domain leak on adapter registration failure Date: Mon, 11 May 2026 16:37:06 +0200 Message-ID: <20260511143715.729714-2-johan@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260511143715.729714-1-johan@kernel.org> References: <20260511143715.729714-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Make sure to tear down the host notify irq domain on adapter registration failure to avoid leaking it. This issue was flagged by Sashiko when reviewing another adapter registration fix. Fixes: 4d5538f5882a ("i2c: use an IRQ to report Host Notify events, not alert") Cc: stable@vger.kernel.org # 4.10 Cc: Benjamin Tissoires Signed-off-by: Johan Hovold --- drivers/i2c/i2c-core-base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9c46147e3506..abe8341c1d6e 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1574,7 +1574,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) if (res) { pr_err("adapter '%s': can't register device (%d)\n", adap->name, res); put_device(&adap->dev); - goto out_list; + goto err_remove_irq_domain; } adap->debugfs = debugfs_create_dir(dev_name(&adap->dev), i2c_debugfs_root); @@ -1609,6 +1609,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap) init_completion(&adap->dev_released); device_unregister(&adap->dev); wait_for_completion(&adap->dev_released); +err_remove_irq_domain: + i2c_host_notify_irq_teardown(adap); out_list: mutex_lock(&core_lock); idr_remove(&i2c_adapter_idr, adap->nr); -- 2.53.0