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=1793212857; b=MWlIAlnZeQUg8UitqksVvSLCaMBfpKJpjZosGVxGWffX8WDPBxs+Y4lsJOXfbthsWw3D 9bXoorpOgInh0/SOZX7SLSY006q6j4JXuSPrdpuFYe7SRy993DxHneDauFyEhao/OmFFW jSTn0TMOIgXCW6N56HjHdDVAKEwOF6tCPWANdhnEC+n1aaScZfrKF25n488VDfL/moP5W IVbMT75vOJRd7IIsHANOzCOeOhJ8WaiGGSE2dj4rcX9GbOi5iZzRrhNlqfB26JKN7NC/U YbOegYtowJL0rOetqqWVzdro0KcH/dU+Xk7WqFhJN2HR54DaxnscGToBizw2Bo8ZuJA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793212857; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=ye8jE+XriR0eZdhIa0R+CThbgGWIR13MqqYvq/ytQlw=; b=1WZs7zWxb7u8KcF+LTh9na5yb9tYBkVGSbHfksnEPOa0EJNviRvwGlitH+C1eg8Wk5xd Kvx0XGQfr4yCbgt3+PyYobKYl5mmex6qa9WpesbDyv98XJ+tmxIUauMhFp6UH0qxrV3Y2 xW/lJ0hCz4tDimFY7jStmLAr6A8+dyEtF0woRNAkSOQFphWb+K5UlvxrRyXLTFQlj1dwo wStPl7THMy78ekDkvuHUbl7wEnZ2BG4jNxwgmLeUCQltMNM1DSXA8rBpWNONCmL1waYPZ GKmmtZCkHi0EYOgZBfwLfbPk46xbUq5bE0pukmbPEJHtA72oH/bo/vCijN5YfrtO7YA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yTuzOY1N; 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 2EFEC606A31C; Wed, 28 Oct 2026 18:40:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yTuzOY1N Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F3CF1F01825; Wed, 28 Oct 2026 18:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793212857; bh=ye8jE+XriR0eZdhIa0R+CThbgGWIR13MqqYvq/ytQlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yTuzOY1NlajxxFAG2RDZ9pA657hKa2luh9Dcj0tH9vbN3rAhPccMekvIEuVnnF8ws YZeJJ1J9LmvRsuI8Zyz1CkIGr48aIYtLg78ZL1Hfo/nT1PLwf4iZR6gZQvKNt5J2m/ OeDJcMrYuNkLxooE8S3AiJPo9xTt7kIPkYo2C3FI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hongjian Dai , Andi Shyti , Sasha Levin Subject: [PATCH 6.1 0248/1887] i2c: at91: release DMA channels when probe defers Date: Wed, 28 Oct 2026 17:39:04 +0100 Message-ID: <20261028170504.874000666@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261028170459.200466217@linuxfoundation.org> References: <20261028170459.200466217@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hongjian Dai [ Upstream commit c98bf3b86609a18ab16d067280257326e557c636 ] at91_twi_probe_master() can return -EPROBE_DEFER from at91_init_twi_recovery_info() after at91_twi_configure_dma() has already claimed the tx/rx DMA channels. at91_twi_probe() then returns without releasing them, and since dma_request_chan() is not devres-managed the channels leak on every deferred probe attempt. Release the channels before deferring the probe. Fixes: f7eeb1af8537 ("i2c: at91: release DMA channels on remove and probe error") Assisted-by: LLM Signed-off-by: Hongjian Dai Signed-off-by: Andi Shyti Link: https://patch.msgid.link/7D85C6CB6BF0A82E+20260929164340.41628-1-daihongjian@kylinsec.com.cn Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-at91-master.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c index 28ed1bde3d68a..593881902a0d9 100644 --- a/drivers/i2c/busses/i2c-at91-master.c +++ b/drivers/i2c/busses/i2c-at91-master.c @@ -919,8 +919,14 @@ int at91_twi_probe_master(struct platform_device *pdev, at91_calc_twi_clock(dev); rc = at91_init_twi_recovery_info(pdev, dev); - if (rc == -EPROBE_DEFER) + if (rc == -EPROBE_DEFER) { + /* + * The DMA channels were already set up above, release them + * before deferring the probe so they are not leaked. + */ + at91_twi_dma_release(dev); return rc; + } dev->adapter.algo = &at91_twi_algorithm; dev->adapter.quirks = &at91_twi_quirks; -- 2.53.0