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=1796388376; b=Jh5gkQ2uwn+aN0NpMBupE74HbHNYPmj7I4bH6jtOLwdQWN9pcBndsckcLZQbNF1I/y0v 1WCCG7VjXqF10ogx+Gy2CDUlqkVB4kJNpOEHJo/JoYz0fagl0+HlxjeeIW5WsQUXyzsLj D28ZW/92FpAqdCRHlFhgGsmO0QbjUxXAcRosyVWorhtRClZW8nzAJmXBTXXqJgnEjBpC6 5xl3WBS5HN6OemOhMM1QA/2gMuqwWlJU7G5fseqbEYbnB8eJmmjjjFBe/vqT1o8wsYYkS fvTGIxSEf3g4ob41yjKAQAjmG6tdf6PdukZFm4l+iew90gPpnFz5U6EoejnNCJ84Npg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388376; 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=c7J9iZx0LaxFwiLnbubLiCx2OyW9aUWlmPDGXJWsukI=; b=r6oTNKdnvkbQi1Gonkw6+TK4Lyu0cz1UcwcQZOJiwbFebOA4q6pHwnKF8BHEcARORykj RqBRn6bqq8ChH3d6u0zkJlgBRHFIyTO37ZqVoUp52y8SevTEF5EvRhgbT4kcKQ6lPmr6j idxbHqaV6tZC4bfnD4bNjtD+eek+o6Ibab6rdnRhy8QQQqsq0J4Gnc8/5C4j3E0eJmdmV HgN2cMnnQKKtsSVj5VMucm+ab8wK5IQX19vFyJapCzjeyZlQtQwXHZW7DhFUn9L8v5ket UfLc7OsDamoVSYRdY+mGp4epduT5QKQnj5NaznOSlgWaP68XHQCqajaXBXG7yJJnhEA== 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=MAbl0L6H; 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 A9640606A32D; Fri, 4 Dec 2026 12:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MAbl0L6H Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2DF51F000CE; Fri, 4 Dec 2026 12:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388376; bh=c7J9iZx0LaxFwiLnbubLiCx2OyW9aUWlmPDGXJWsukI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MAbl0L6HurWU9wrv48dScYfUDRIPrmS2lIo0RCm0v3Q2AWmmOv5J+QuqSjoWzZFHE zc49PLcKUekTd9torBiIqQI3rIzTzTg/R84v16EvXmZWz4Xs1oao3JE9nfVWwzeMzv iHkh+lTqAjwHaUaoxugSN3JDMkICnJfowZbbuqJ0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Krzysztof Kozlowski , Peter Griffin , Alim Akhtar , Jiri Slaby , Kukjin Kim , Thomas Abraham , Josef Bacik Subject: [PATCH 6.1 0590/1059] serial: samsung: put the previous baud clock Date: Fri, 4 Dec 2026 19:02:01 +0900 Message-ID: <20261204100659.430461209@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore 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-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik commit eedf2cf3505c1562a2fb24f8b997056f023d242b upstream. s3c24xx_serial_getclk() returns the best baud clock with the reference which clk_get() has taken. s3c24xx_serial_set_termios() stores it in ourport->baudclk and disables the clock which was there before, but does not put it. clk_get() hands out a new handle on every call, so the new clock never equals the old one, and every call of ->set_termios() leaks a handle: a struct clk and a copy of the connection name. Whoever has the port open can repeat that at will with tcsetattr(). Put the old clock when it is replaced, and the new one in case it is not stored. Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lookup") Cc: stable Cc: Krzysztof Kozlowski Cc: Peter Griffin Cc: Alim Akhtar Cc: Jiri Slaby Cc: Kukjin Kim Cc: Thomas Abraham Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-22-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/samsung_tty.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1570,11 +1570,14 @@ static void s3c24xx_serial_set_termios(s if (!IS_ERR(ourport->baudclk)) { clk_disable_unprepare(ourport->baudclk); + clk_put(ourport->baudclk); ourport->baudclk = ERR_PTR(-EINVAL); } ourport->baudclk = clk; ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0; + } else { + clk_put(clk); } if (ourport->info->has_divslot) {